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

This commit is contained in:
2025-06-23 09:18:35 +08:00
parent 503695b28c
commit f140031266

View File

@@ -107,7 +107,9 @@ export class BlogService {
async createComment(comment: Partial<BlogComment>) {
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) {