refactor(server): improve workspace content retrieval from database (#10964)

This commit is contained in:
fengmk2
2025-03-19 12:16:53 +00:00
parent a9b53839a6
commit ddd6c97b08
3 changed files with 59 additions and 26 deletions

View File

@@ -74,18 +74,7 @@ export class NotificationService {
}
private async ensureWorkspaceContentExists(workspaceId: string) {
const workspace = await this.models.workspace.get(workspaceId);
if (!workspace || workspace.name) {
return;
}
const content = await this.docReader.getWorkspaceContent(workspaceId);
if (!content?.name) {
return;
}
await this.models.workspace.update(workspaceId, {
name: content.name,
avatarKey: content.avatarKey,
});
await this.docReader.getWorkspaceContent(workspaceId);
}
async markAsRead(userId: string, notificationId: string) {