mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
feat(server): add doc meta for ignored docs (#12021)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Ignored documents in workspace embedding now display additional metadata, including document title, creation and update timestamps, and the names and avatars of users who created or updated the document. - **Enhancements** - The list of ignored documents provides richer information for easier identification and management within the workspace. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -373,6 +373,29 @@ export class DocModel extends BaseModel {
|
||||
});
|
||||
}
|
||||
|
||||
async findAuthors(ids: { workspaceId: string; docId: string }[]) {
|
||||
const rows = await this.db.snapshot.findMany({
|
||||
where: {
|
||||
workspaceId: { in: ids.map(id => id.workspaceId) },
|
||||
id: { in: ids.map(id => id.docId) },
|
||||
},
|
||||
select: {
|
||||
workspaceId: true,
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
createdByUser: { select: publicUserSelect },
|
||||
updatedByUser: { select: publicUserSelect },
|
||||
},
|
||||
});
|
||||
const resultMap = new Map(
|
||||
rows.map(row => [`${row.workspaceId}-${row.id}`, row])
|
||||
);
|
||||
return ids.map(
|
||||
id => resultMap.get(`${id.workspaceId}-${id.docId}`) ?? null
|
||||
);
|
||||
}
|
||||
|
||||
async findMetas(ids: { workspaceId: string; docId: string }[]) {
|
||||
const rows = await this.db.workspaceDoc.findMany({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user