diff --git a/src/modules/comment/comment.model.ts b/src/modules/comment/comment.model.ts index 23644450..2f679eb2 100644 --- a/src/modules/comment/comment.model.ts +++ b/src/modules/comment/comment.model.ts @@ -60,7 +60,7 @@ export class CommentModel extends BaseModel { author!: string @prop({ trim: true }) - mail?: string + mail: string @prop({ trim: true, diff --git a/src/modules/comment/comment.service.ts b/src/modules/comment/comment.service.ts index ee7bf700..0ad5c544 100644 --- a/src/modules/comment/comment.service.ts +++ b/src/modules/comment/comment.service.ts @@ -232,17 +232,17 @@ export class CommentService { time.getMonth() + 1 }/${time.getFullYear()}` - if (!parent || !parent.mail || !refDoc || !master.mail || !model.mail) { + if (!refDoc || !master.mail) { return } this.mailService.sendCommentNotificationMail({ - to: type === ReplyMailType.Owner ? master.mail : parent.mail, + to: type === ReplyMailType.Owner ? master.mail : parent!.mail, type, source: { title: refDoc.title, text: model.text, - author: type === ReplyMailType.Guest ? parent.author : model.author, + author: type === ReplyMailType.Guest ? parent!.author : model.author, master: master.name, link: await this.resolveUrlByType(refType, refDoc), time: parsedTime,