zahmis 5 лет назад
Родитель
Сommit
91ad34a18e

+ 2 - 5
src/client/js/components/MyBookmarkList/MyBookmarkList.jsx

@@ -18,13 +18,12 @@ class MyBookmarkList extends React.Component {
 
   constructor(props) {
     super(props);
-    const { appContainer } = this.props;
 
     this.state = {
       pages: [],
       activePage: 1,
       totalPages: 0,
-      pagingLimit: appContainer.getConfig().pageLimitationM || 30,
+      pagingLimit: Infinity,
     };
 
     this.handlePage = this.handlePage.bind(this);
@@ -41,12 +40,10 @@ class MyBookmarkList extends React.Component {
   async getMyBookmarkList(selectPageNumber) {
     const { appContainer } = this.props;
     const userId = appContainer.currentUserId;
-    const limit = this.state.pagingLimit;
     const page = selectPageNumber;
-    const params = { page, limit };
 
     try {
-      const { data } = await this.props.appContainer.apiv3.get(`/bookmarks/${userId}`, params);
+      const { data } = await this.props.appContainer.apiv3.get(`/bookmarks/${userId}`, { page });
       if (data.paginationResult == null) {
         throw new Error('data must conclude \'paginateResult\' property.');
       }

+ 0 - 1
src/client/js/components/RecentCreated/RecentCreated.jsx

@@ -39,7 +39,6 @@ class RecentCreated extends React.Component {
     // pagesList get and pagination calculate
     const res = await appContainer.apiv3Get(`/users/${userId}/recent`, { selectPageNumber });
     const { totalCount, pages, limit } = res.data;
-    console.log(res.data.limit);
 
     this.setState({
       pages,

+ 4 - 3
src/server/routes/apiv3/bookmarks.js

@@ -150,11 +150,12 @@ module.exports = (crowi) => {
   router.get('/:userId', accessTokenParser, loginRequired, validator.myBookmarkList, apiV3FormValidator, async(req, res) => {
     const { userId } = req.params;
     const page = req.query.page;
-    const limit = req.query.limit || 30;
+    const pageLimitationM = parseInt(req.query.pageLimitationM) || await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM') || 30;
+
     if (userId == null) {
       return res.apiv3Err('User id is not found or forbidden', 400);
     }
-    if (limit == null) {
+    if (pageLimitationM == null) {
       return res.apiv3Err('Could not catch page limit', 400);
     }
     try {
@@ -173,7 +174,7 @@ module.exports = (crowi) => {
             },
           },
           page,
-          limit,
+          limit: pageLimitationM,
         },
       );
       return res.apiv3({ paginationResult });