itizawa 6 лет назад
Родитель
Сommit
645e349eec

+ 1 - 0
src/client/js/components/PageComment/Comment.jsx

@@ -265,6 +265,7 @@ class Comment extends React.Component {
             commentBody={comment.comment}
             replyTo={undefined}
             commentButtonClickedHandler={this.commentButtonClickedHandler}
+            creatorId={creator._id}
           />
         ) : (
           <div className={rootClassName}>

+ 1 - 0
src/client/js/components/PageComment/CommentEditor.jsx

@@ -115,6 +115,7 @@ class CommentEditor extends React.Component {
           this.state.comment,
           this.state.isMarkdown,
           this.props.currentCommentId,
+          this.props.creatorId,
         );
       }
       else {

+ 2 - 1
src/client/js/services/CommentContainer.js

@@ -103,7 +103,7 @@ export default class CommentContainer extends Container {
   /**
    * Load data of comments and rerender <PageComments />
    */
-  putComment(comment, isMarkdown, commentId) {
+  putComment(comment, isMarkdown, commentId, creatorId) {
     const { pageId, revisionId } = this.getPageContainer().state;
 
     return this.appContainer.apiPost('/comments.update', {
@@ -113,6 +113,7 @@ export default class CommentContainer extends Container {
         revision_id: revisionId,
         is_markdown: isMarkdown,
         comment_id: commentId,
+        creator_id: creatorId,
       },
     })
       .then((res) => {

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

@@ -161,6 +161,7 @@ module.exports = function(crowi, app) {
     const comment = commentForm.comment;
     const isMarkdown = commentForm.is_markdown;
     const commentId = commentForm.comment_id;
+    const creatorId = commentForm.creator_id;
 
     if (comment === '') {
       return res.json(ApiResponse.error('Comment text is required'));