server: fix collaboration deleted doc

This commit is contained in:
fantasticit 2022-08-08 19:09:19 +08:00
parent abea1fbd6f
commit 7685ca4be3
1 changed files with 2 additions and 1 deletions

View File

@ -267,13 +267,14 @@ export class CollaborationService {
if (docType === 'document') {
const data = await this.documentService.findById(targetId);
if (data && !data.title) {
await this.documentService.updateDocument({ id: userId } as IUser, targetId, {
title: '未命名文档',
});
}
if (editable) {
if (data && editable) {
const content = data.content;
const json = JSON.parse(content).default;
const mentionUsers = findMentions(json);