mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-28 15:55:19 +08:00
feat(server): adapt context model (#11028)
expose more field in listContextObject
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user