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

move CommentContainer to services

Yuki Takei 6 лет назад
Родитель
Сommit
b43c1e9952

+ 1 - 1
src/client/js/app.js

@@ -47,7 +47,7 @@ import GroupDeleteModal from './components/GroupDeleteModal/GroupDeleteModal';
 
 import AppContainer from './services/AppContainer';
 import PageContainer from './services/PageContainer';
-import CommentContainer from './components/PageComment/CommentContainer';
+import CommentContainer from './services/CommentContainer';
 import EditorContainer from './services/EditorContainer';
 import WebsocketContainer from './services/WebsocketContainer';
 

+ 5 - 4
src/client/js/components/PageComment/CommentEditor.jsx

@@ -8,17 +8,18 @@ import Button from 'react-bootstrap/es/Button';
 import Tab from 'react-bootstrap/es/Tab';
 import Tabs from 'react-bootstrap/es/Tabs';
 import * as toastr from 'toastr';
-import UserPicture from '../User/UserPicture';
-import ReactUtils from '../ReactUtils';
 
 import AppContainer from '../../services/AppContainer';
+import CommentContainer from '../../services/CommentContainer';
 import GrowiRenderer from '../../util/GrowiRenderer';
 
+import ReactUtils from '../ReactUtils';
+import UserPicture from '../User/UserPicture';
 import Editor from '../PageEditor/Editor';
-import CommentContainer from './CommentContainer';
-import CommentPreview from './CommentPreview';
 import SlackNotification from '../SlackNotification';
 
+import CommentPreview from './CommentPreview';
+
 /**
  *
  * @author Yuki Takei <yuki@weseek.co.jp>

+ 1 - 1
src/client/js/components/PageComments.jsx

@@ -10,7 +10,7 @@ import { withTranslation } from 'react-i18next';
 import GrowiRenderer from '../util/GrowiRenderer';
 
 import AppContainer from '../services/AppContainer';
-import CommentContainer from './PageComment/CommentContainer';
+import CommentContainer from '../services/CommentContainer';
 
 import CommentEditor from './PageComment/CommentEditor';
 

+ 0 - 2
src/client/js/components/PageComment/CommentContainer.jsx → src/client/js/services/CommentContainer.js

@@ -69,7 +69,6 @@ export default class CommentContainer extends Container {
     return this.appContainer.apiPost('/comments.add', {
       commentForm: {
         comment,
-        _csrf: this.appContainer.csrfToken,
         page_id: pageId,
         revision_id: revisionId,
         is_markdown: isMarkdown,
@@ -101,7 +100,6 @@ export default class CommentContainer extends Container {
 
     const endpoint = '/attachments.add';
     const formData = new FormData();
-    formData.append('_csrf', this.appContainer.csrfToken);
     formData.append('file', file);
     formData.append('path', pagePath);
     formData.append('page_id', pageId);