Forráskód Böngészése

fix variable name

zahmis 5 éve
szülő
commit
645ae98703

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

@@ -40,10 +40,9 @@ class MyBookmarkList extends React.Component {
   async getMyBookmarkList(selectPageNumber) {
   async getMyBookmarkList(selectPageNumber) {
     const { appContainer } = this.props;
     const { appContainer } = this.props;
     const userId = appContainer.currentUserId;
     const userId = appContainer.currentUserId;
-    const page = selectPageNumber;
 
 
     try {
     try {
-      const { data } = await this.props.appContainer.apiv3.get(`/bookmarks/${userId}`, { page });
+      const { data } = await this.props.appContainer.apiv3.get(`/bookmarks/${userId}`, { selectPageNumber });
       if (data.paginationResult == null) {
       if (data.paginationResult == null) {
         throw new Error('data must conclude \'paginateResult\' property.');
         throw new Error('data must conclude \'paginateResult\' property.');
       }
       }

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

@@ -144,7 +144,7 @@ module.exports = (crowi) => {
    *                  $ref: '#/components/schemas/Bookmark'
    *                  $ref: '#/components/schemas/Bookmark'
    */
    */
   validator.myBookmarkList = [
   validator.myBookmarkList = [
-    query('page').isInt({ min: 1 }),
+    query('selectPageNumber').isInt({ min: 1 }),
     query('pageLimitationM').custom((value) => {
     query('pageLimitationM').custom((value) => {
       if (value === undefined) {
       if (value === undefined) {
         return 10;
         return 10;
@@ -158,7 +158,7 @@ module.exports = (crowi) => {
 
 
   router.get('/:userId', accessTokenParser, loginRequired, validator.myBookmarkList, apiV3FormValidator, async(req, res) => {
   router.get('/:userId', accessTokenParser, loginRequired, validator.myBookmarkList, apiV3FormValidator, async(req, res) => {
     const { userId } = req.params;
     const { userId } = req.params;
-    const page = req.query.page;
+    const selectPageNumber = req.query.selectPageNumber;
     const pageLimitationM = parseInt(req.query.pageLimitationM) || await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM') || 30;
     const pageLimitationM = parseInt(req.query.pageLimitationM) || await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM') || 30;
 
 
     if (userId == null) {
     if (userId == null) {
@@ -182,7 +182,7 @@ module.exports = (crowi) => {
               select: User.USER_PUBLIC_FIELDS,
               select: User.USER_PUBLIC_FIELDS,
             },
             },
           },
           },
-          page,
+          page: selectPageNumber,
           limit: pageLimitationM,
           limit: pageLimitationM,
         },
         },
       );
       );