zamis пре 5 година
родитељ
комит
acca02d0e7

+ 4 - 4
src/client/js/components/Admin/UserGroupDetail/UserGroupPageList.jsx

@@ -17,7 +17,7 @@ class UserGroupPageList extends React.Component {
     this.state = {
       currentPages: [],
       activePage: 1,
-      totalDocs: 0,
+      total: 0,
       pagingLimit: 10,
     };
 
@@ -37,10 +37,10 @@ class UserGroupPageList extends React.Component {
         limit,
         offset,
       });
-      const { totalDocs, pages } = res.data;
+      const { total, pages } = res.data;
 
       this.setState({
-        totalDocs,
+        total,
         activePage: pageNum,
         currentPages: pages,
       });
@@ -63,7 +63,7 @@ class UserGroupPageList extends React.Component {
           <PaginationWrapper
             activePage={this.state.activePage}
             changePage={this.handlePageChange}
-            totalItemsCount={this.state.totalDocs}
+            totalItemsCount={this.state.total}
             pagingLimit={this.state.pagingLimit}
             align="center"
             size="sm"

+ 1 - 1
src/server/routes/apiv3/user-group.js

@@ -593,7 +593,7 @@ module.exports = (crowi) => {
       const current = offset / limit + 1;
 
       // TODO: create a common moudule for paginated response
-      return res.apiv3({ totalDocs, current, pages: docs });
+      return res.apiv3({ total: totalDocs, current, pages: docs });
     }
     catch (err) {
       const msg = `Error occurred in fetching pages for group: ${id}`;