zahmis před 5 roky
rodič
revize
1003e1ffdf

+ 5 - 7
src/client/js/components/PageTimeline.jsx

@@ -17,7 +17,6 @@ class PageTimeline extends React.Component {
     super(props);
     super(props);
 
 
     const { appContainer } = this.props;
     const { appContainer } = this.props;
-    this.showPages = this.showPages.bind(this);
     this.handlePage = this.handlePage.bind(this);
     this.handlePage = this.handlePage.bind(this);
     this.state = {
     this.state = {
       activePage: 1,
       activePage: 1,
@@ -30,17 +29,15 @@ class PageTimeline extends React.Component {
 
 
   }
   }
 
 
-  async handlePage(selectedPage) {
-    await this.showPages(selectedPage);
-  }
 
 
-  async showPages(selectedPage) {
+  async handlePage(selectedPage) {
     const { appContainer, pageContainer } = this.props;
     const { appContainer, pageContainer } = this.props;
     const { path } = pageContainer.state;
     const { path } = pageContainer.state;
     const limit = this.state.limit;
     const limit = this.state.limit;
     const offset = (selectedPage - 1) * limit;
     const offset = (selectedPage - 1) * limit;
-    const res = await appContainer.apiv3Get('/pages/list', { path, limit, offset });
     const activePage = selectedPage;
     const activePage = selectedPage;
+
+    const res = await appContainer.apiv3Get('/pages/list', { path, limit, offset });
     const totalPages = res.data.totalCount;
     const totalPages = res.data.totalCount;
     const pages = res.data.pages;
     const pages = res.data.pages;
     this.setState({
     this.setState({
@@ -55,7 +52,8 @@ class PageTimeline extends React.Component {
 
 
     // initialize GrowiRenderer
     // initialize GrowiRenderer
     this.growiRenderer = appContainer.getRenderer('timeline');
     this.growiRenderer = appContainer.getRenderer('timeline');
-    this.showPages(1);
+    this.handlePage(1);
+
   }
   }
 
 
   render() {
   render() {

+ 3 - 1
src/server/routes/apiv3/pages.js

@@ -90,9 +90,11 @@ module.exports = (crowi) => {
     const offset = +req.query.offset || 0;
     const offset = +req.query.offset || 0;
     const queryOptions = { offset, limit };
     const queryOptions = { offset, limit };
 
 
+    console.log(limit);
+
     try {
     try {
       const result = await Page.findListWithDescendants(path, req.user, queryOptions);
       const result = await Page.findListWithDescendants(path, req.user, queryOptions);
-
+      console.log(result);
       return res.apiv3(result);
       return res.apiv3(result);
     }
     }
     catch (err) {
     catch (err) {