shinoka7 6 лет назад
Родитель
Сommit
caaacc7ac1
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      src/server/models/comment.js
  2. 1 1
      src/server/routes/comment.js

+ 1 - 0
src/server/models/comment.js

@@ -29,6 +29,7 @@ module.exports = function(crowi) {
       newComment.comment = comment;
       newComment.comment = comment;
       newComment.commentPosition = position;
       newComment.commentPosition = position;
       newComment.isMarkdown = isMarkdown || false;
       newComment.isMarkdown = isMarkdown || false;
+      newComment.replyTo = replyTo;
 
 
       newComment.save((err, data) => {
       newComment.save((err, data) => {
         if (err) {
         if (err) {

+ 1 - 1
src/server/routes/comment.js

@@ -74,7 +74,7 @@ module.exports = function(crowi, app) {
     const comment = commentForm.comment;
     const comment = commentForm.comment;
     const position = commentForm.comment_position || -1;
     const position = commentForm.comment_position || -1;
     const isMarkdown = commentForm.is_markdown;
     const isMarkdown = commentForm.is_markdown;
-    const replyTo = commentForm.replyTo;
+    const replyTo = commentForm.replyTo === '' ? undefined : commentForm.replyTo;
 
 
     // check whether accessible
     // check whether accessible
     const isAccessible = await Page.isAccessiblePageByViewer(pageId, req.user);
     const isAccessible = await Page.isAccessiblePageByViewer(pageId, req.user);