itizawa 6 лет назад
Родитель
Сommit
e8493ac2b7
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      src/server/models/comment.js

+ 7 - 4
src/server/models/comment.js

@@ -64,11 +64,14 @@ module.exports = function(crowi) {
     }));
   };
 
-  commentSchema.statics.updateCommentsByPageId = function(comment, isMarkdown, pageId) {
-    // TODO GW-61 update new comment add return comment data
-    console.log('ここはmodel');
+  commentSchema.statics.updateCommentsByPageId = function(comment, isMarkdown, commentId) {
+    const Comment = this;
+
+    return Comment.findOneAndUpdate(
+      { _id: commentId },
+      { $set: { comment, isMarkdown } },
+    );
 
-    return pageId;
   };
 
   commentSchema.statics.removeCommentsByPageId = function(pageId) {