Skip to content

Commit 2168057

Browse files
committed
fix docs listing schema drift
1 parent b9eb296 commit 2168057

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/lib/knowledge/documents/service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,7 @@ export async function getDocuments(
997997
): Promise<{
998998
documents: Array<{
999999
id: string
1000+
knowledgeBaseId: string
10001001
filename: string
10011002
fileUrl: string
10021003
fileSize: number
@@ -1079,7 +1080,7 @@ export async function getDocuments(
10791080
.from(document)
10801081
.where(and(...whereConditions))
10811082

1082-
const total = totalResult[0]?.count || 0
1083+
const total = Number(totalResult[0]?.count ?? 0)
10831084
const hasMore = offset + limit < total
10841085

10851086
const getOrderByColumn = () => {
@@ -1110,6 +1111,7 @@ export async function getDocuments(
11101111
const documents = await db
11111112
.select({
11121113
id: document.id,
1114+
knowledgeBaseId: document.knowledgeBaseId,
11131115
filename: document.filename,
11141116
fileUrl: document.fileUrl,
11151117
fileSize: document.fileSize,
@@ -1158,6 +1160,7 @@ export async function getDocuments(
11581160
return {
11591161
documents: documents.map((doc) => ({
11601162
id: doc.id,
1163+
knowledgeBaseId: doc.knowledgeBaseId,
11611164
filename: doc.filename,
11621165
fileUrl: doc.fileUrl,
11631166
fileSize: doc.fileSize,

0 commit comments

Comments
 (0)