Explorar el Código

adjust validator

itizawa hace 5 años
padre
commit
d554b3d5dd
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/server/routes/apiv3/pages.js

+ 1 - 1
src/server/routes/apiv3/pages.js

@@ -37,7 +37,7 @@ module.exports = (crowi) => {
         .withMessage('body is required'),
       body('path').exists().not().isEmpty({ ignore_whitespace: true })
         .withMessage('path is required'),
-      body('grant').if(value => value != null).isInt({ min: 1, max: 5 }).withMessage('grant must be integer from 1 to 5'),
+      body('grant').if(value => value != null).isInt({ min: 0, max: 5 }).withMessage('grant must be integer from 1 to 5'),
       body('overwriteScopesOfDescendants').if(value => value != null).isBoolean().withMessage('overwriteScopesOfDescendants must be boolean'),
       body('isSlackEnabled').if(value => value != null).isBoolean().withMessage('isSlackEnabled must be boolean'),
       body('slackChannels').if(value => value != null).isString().withMessage('slackChannels must be string'),