kaori 4 лет назад
Родитель
Сommit
03964740ac
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      packages/app/src/server/models/comment.js

+ 4 - 2
packages/app/src/server/models/comment.js

@@ -65,17 +65,19 @@ module.exports = function(crowi) {
     }));
   };
 
-  commentSchema.statics.updateCommentsByPageId = async(comment, isMarkdown, commentId) => {
+  commentSchema.statics.updateCommentsByPageId = async function(comment, isMarkdown, commentId) {
     const Comment = this;
     const commentEvent = crowi.event('comment');
 
     await commentEvent.emit('update', comment.creator);
 
-    return Comment.findOneAndUpdate(
+    const commentData = await Comment.findOneAndUpdate(
       { _id: commentId },
       { $set: { comment, isMarkdown } },
     );
 
+    return commentData;
+
   };
 
   commentSchema.statics.removeCommentsByPageId = function(pageId) {