mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 19:16:29 +08:00
fix(server): make status optional (#11176)
This commit is contained in:
@@ -83,18 +83,15 @@ export class CopilotContextModel extends BaseModel {
|
||||
return row;
|
||||
}
|
||||
|
||||
async mergeDocStatus(
|
||||
workspaceId: string,
|
||||
docs: (ContextDoc & { status?: ContextEmbedStatus | null })[]
|
||||
) {
|
||||
async mergeDocStatus(workspaceId: string, docs: ContextDoc[]) {
|
||||
const docIds = Array.from(new Set(docs.map(doc => doc.id)));
|
||||
const finishedDoc = await this.hasWorkspaceEmbedding(workspaceId, docIds);
|
||||
|
||||
for (const doc of docs) {
|
||||
const status = finishedDoc.has(doc.id)
|
||||
? ContextEmbedStatus.finished
|
||||
: null;
|
||||
doc.status = status;
|
||||
: undefined;
|
||||
doc.status = status || doc.status;
|
||||
}
|
||||
|
||||
return docs;
|
||||
|
||||
Reference in New Issue
Block a user