feat(server): adapt context model (#11028)

expose more field in listContextObject
This commit is contained in:
darkskygit
2025-03-21 05:36:45 +00:00
parent a5b975ac46
commit 5acba9d5a0
25 changed files with 537 additions and 377 deletions
+17
View File
@@ -185,6 +185,23 @@ export class DocModel extends BaseModel {
});
}
/**
* Check if all doc exists in the workspace.
* Ignore pending updates.
*/
async existsAll(workspaceId: string, docIds: string[]) {
const count = await this.db.snapshot.count({
where: {
workspaceId,
id: { in: docIds },
},
});
if (count === docIds.length) {
return true;
}
return false;
}
/**
* Detect a doc exists or not, including updates
*/