kaori %!s(int64=4) %!d(string=hai) anos
pai
achega
03964740ac
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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) {