shinoka7 7 tahun lalu
induk
melakukan
c578605359
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      src/server/models/comment.js

+ 3 - 3
src/server/models/comment.js

@@ -14,10 +14,10 @@ module.exports = function(crowi) {
     commentPosition: { type: Number, default: -1 },
     createdAt: { type: Date, default: Date.now },
     isMarkdown: { type: Boolean, default: false },
-    // replyTo: { type: ObjectId, default: null },
+    replyTo: { type: ObjectId, default: undefined },
   });
 
-  commentSchema.statics.create = function(pageId, creatorId, revisionId, comment, position, isMarkdown /* , replyTo */) {
+  commentSchema.statics.create = function(pageId, creatorId, revisionId, comment, position, isMarkdown, replyTo) {
     const Comment = this;
 
     return new Promise(((resolve, reject) => {
@@ -29,7 +29,7 @@ module.exports = function(crowi) {
       newComment.comment = comment;
       newComment.commentPosition = position;
       newComment.isMarkdown = isMarkdown || false;
-      // newComment.replyTo = replyTo || null;
+      newComment.replyTo = replyTo;
 
       newComment.save((err, data) => {
         if (err) {