Bläddra i källkod

imprv router logic

Shun Miyazawa 2 år sedan
förälder
incheckning
d9b66e7033
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      apps/app/src/server/routes/apiv3/pages/index.js

+ 2 - 2
apps/app/src/server/routes/apiv3/pages/index.js

@@ -163,7 +163,7 @@ module.exports = (crowi) => {
     recent: [
     recent: [
       query('limit').optional().isInt().withMessage('limit must be integer'),
       query('limit').optional().isInt().withMessage('limit must be integer'),
       query('offset').optional().isInt().withMessage('offset must be integer'),
       query('offset').optional().isInt().withMessage('offset must be integer'),
-      query('includeWipPage').optional().isBoolean().withMessage('includeWipPages must be boolean'),
+      query('includeWipPage').optional().isBoolean().withMessage('includeWipPage must be boolean'),
     ],
     ],
     renamePage: [
     renamePage: [
       body('pageId').isMongoId().withMessage('pageId is required'),
       body('pageId').isMongoId().withMessage('pageId is required'),
@@ -224,7 +224,7 @@ module.exports = (crowi) => {
   router.get('/recent', accessTokenParser, loginRequired, validator.recent, apiV3FormValidator, async(req, res) => {
   router.get('/recent', accessTokenParser, loginRequired, validator.recent, apiV3FormValidator, async(req, res) => {
     const limit = parseInt(req.query.limit) || 20;
     const limit = parseInt(req.query.limit) || 20;
     const offset = parseInt(req.query.offset) || 0;
     const offset = parseInt(req.query.offset) || 0;
-    const includeWipPage = JSON.parse(req.query.includeWipPage ?? true); // String to boolean, Requires validation by express-validator before conversion
+    const includeWipPage = req.query.includeWipPage === 'true'; // Need validation using express-validator
 
 
     const queryOptions = {
     const queryOptions = {
       offset,
       offset,