修复评论时返回博客实体的问题
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user