Просмотр исходного кода

feat/thread_comments_backend/save whether or not thread to database

shinoka7 6 лет назад
Родитель
Сommit
dfa28deee8

+ 2 - 0
src/client/js/components/PageComment/CommentForm.jsx

@@ -113,6 +113,7 @@ export default class CommentForm extends React.Component {
         page_id: this.props.pageId,
         revision_id: this.props.revisionId,
         is_markdown: this.state.isMarkdown,
+        replyTo: this.props.replyTo,
       },
       slackNotificationForm: {
         isSlackEnabled: this.state.isSlackEnabled,
@@ -375,6 +376,7 @@ CommentForm.propTypes = {
   pagePath: PropTypes.string,
   editorOptions: PropTypes.object,
   slackChannels: PropTypes.string,
+  replyTo: PropTypes.string,
 };
 CommentForm.defaultProps = {
   editorOptions: {},

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

@@ -74,6 +74,7 @@ module.exports = function(crowi, app) {
     const comment = commentForm.comment;
     const position = commentForm.comment_position || -1;
     const isMarkdown = commentForm.is_markdown;
+    const replyTo = commentForm.replyTo;
 
     // check whether accessible
     const isAccessible = await Page.isAccessiblePageByViewer(pageId, req.user);
@@ -81,7 +82,7 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error('Current user is not accessible to this page.'));
     }
 
-    const createdComment = await Comment.create(pageId, req.user._id, revisionId, comment, position, isMarkdown)
+    const createdComment = await Comment.create(pageId, req.user._id, revisionId, comment, position, isMarkdown, replyTo)
       .catch((err) => {
         return res.json(ApiResponse.error(err));
       });