ryuichi-e 5 лет назад
Родитель
Сommit
f3ab7f4b3e
1 измененных файлов с 8 добавлено и 5 удалено
  1. 8 5
      src/client/js/components/MyBookmarkList/MyBookmarkList.jsx

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

@@ -43,19 +43,22 @@ class MyBookmarkList extends React.Component {
     const userId = appContainer.currentUserId;
     const limit = appContainer.getConfig().recentCreatedLimit;
     const offset = (selectPageNumber - 1) * limit;
-    const params = { limit, offset };
+    const page = selectPageNumber;
+    const params = { page, limit, offset };
 
     try {
       const { data } = await this.props.appContainer.apiv3.get(`/bookmarks/${userId}`, params);
-      if (data.paginateResult == null) {
+      /* if (data.paginateResult == null) {
         throw new Error('data must conclude \'paginateResult\' property.');
-      }
-      const { docs: pages, totalDocs: totalPages, limit: pagingLimit } = data.paginateResult;
+      } */
+      const {
+        docs: pages, totalDocs: totalPages, limit: pagingLimit, page: activePage,
+      } = data.paginationResult;
       this.setState({
         pages,
         totalPages,
         pagingLimit,
-        activePage: selectPageNumber,
+        activePage,
       });
     }
     catch (error) {