Browse Source

remove sort and limit

ryuichi-e 5 years ago
parent
commit
8251f7b273
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/server/routes/apiv3/share-links.js

+ 4 - 6
src/server/routes/apiv3/share-links.js

@@ -27,23 +27,21 @@ module.exports = (crowi) => {
     Page,
   } = crowi.models;
 
+  const { ApiV3FormValidator } = crowi.middlewares;
+
   // TDOO write swagger
-  router.get('/', loginRequired, async(req, res) => {
+  router.get('/', /* loginRequired, csrf, */ ApiV3FormValidator, async(req, res) => {
     const { pageId } = req.query;
     try {
       const paginateResult = await Page.paginate(
         {
           _id: { $in: pageId },
         },
-        {
-          sort: 1,
-          limit: 50,
-        },
       );
       return res.apiv3({ paginateResult });
     }
     catch (err) {
-      const msg = 'Error occurred in delete share link';
+      const msg = 'Error occurred in get share link';
       logger.error('Error', err);
       return res.apiv3Err(new ErrorV3(msg, 'get-shareLink-failed'));
     }