修复评论时返回博客实体的问题

This commit is contained in:
2025-06-23 09:18:35 +08:00
parent 4d660d4495
commit e4dba6103e

View File

@@ -107,7 +107,9 @@ export class BlogService {
async createComment(comment: Partial<BlogComment>) { async createComment(comment: Partial<BlogComment>) {
const newComment = this.blogCommentRepository.create(comment); const newComment = this.blogCommentRepository.create(comment);
return this.blogCommentRepository.save(newComment); const savedComment = await this.blogCommentRepository.save(newComment, {});
const { blog, ...commentWithoutBlog } = savedComment;
return commentWithoutBlog;
} }
hashPassword(password: string) { hashPassword(password: string) {