Bladeren bron

remove unnecessary code

yusuketk 7 jaren geleden
bovenliggende
commit
9d6278d867
2 gewijzigde bestanden met toevoegingen van 4 en 9 verwijderingen
  1. 3 8
      src/client/js/components/Page/EditTagModal.jsx
  2. 1 1
      src/client/js/components/Page/RevisionPath.js

+ 3 - 8
src/client/js/components/Page/EditTagModal.jsx

@@ -16,7 +16,6 @@ export default class EditTagModal extends React.Component {
       isOpenEditTagModal: false,
     };
 
-    this.getPageTags = this.getPageTags.bind(this);
     this.updateTags = this.updateTags.bind(this);
     this.handleShowEditTagModal = this.handleShowEditTagModal.bind(this);
     this.handleCloseEditTagModal = this.handleCloseEditTagModal.bind(this);
@@ -26,16 +25,12 @@ export default class EditTagModal extends React.Component {
   async componentWillMount() {
     // set pageTag on button
     if (this.props.pageId) {
-      const pageTags = await this.getPageTags(this.props.pageId);
-      this.setState({ pageTags });
+      const pageId = this.props.pageId;
+      const res = await this.props.crowi.apiGet('/tags.get', { pageId });
+      this.setState({ pageTags: res.tags });
     }
   }
 
-  async getPageTags(pageId) {
-    const res = await this.props.crowi.apiGet('/tags.get', { pageId });
-    return res.tags;
-  }
-
   updateTags(newPageTags) {
     this.setState({ newPageTags });
   }

+ 1 - 1
src/client/js/components/Page/RevisionPath.js

@@ -19,7 +19,7 @@ export default class RevisionPath extends React.Component {
     this.xss = window.xss;
   }
 
-  async componentWillMount() {
+  componentWillMount() {
     // whether list page or not
     const isListPage = this.props.pagePath.match(/\/$/);
     this.setState({ isListPage });