Explorar el Código

Revert "use api for slackchannels"

This reverts commit bd3d9d6c304a012c26a4dc3535b5ad0266ab0b8b.
sou hace 7 años
padre
commit
cf77b7b110
Se han modificado 1 ficheros con 2 adiciones y 10 borrados
  1. 2 10
      resource/js/components/PageComment/CommentForm.js

+ 2 - 10
resource/js/components/PageComment/CommentForm.js

@@ -42,7 +42,7 @@ export default class CommentForm extends React.Component {
       errorMessage: undefined,
       hasSlackConfig: config.hasSlackConfig,
       isSlackEnabled: false,
-      slackChannels: '',
+      slackChannels: this.props.slackChannels,
     };
 
     this.growiRenderer = new GrowiRenderer(this.props.crowi, this.props.crowiOriginRenderer, {mode: 'comment'});
@@ -58,15 +58,6 @@ export default class CommentForm extends React.Component {
     this.onSlackOnChange = this.onSlackOnChange.bind(this);
   }
 
-  componentWillMount() {
-    this.props.crowi.apiGet('/pages.updatePost', {path: this.props.pagePath})
-      .then(res => {
-        if (res.ok) {
-          this.setState({slackChannels: res.updatePost.join(', ')});
-        }
-      });
-  }
-
   updateState(value) {
     this.setState({comment: value});
   }
@@ -308,6 +299,7 @@ CommentForm.propTypes = {
   revisionId: PropTypes.string,
   pagePath: PropTypes.string,
   editorOptions: PropTypes.object,
+  slackChannels: PropTypes.string,
 };
 CommentForm.defaultProps = {
   editorOptions: {},