|
@@ -159,8 +159,8 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
const validator = {
|
|
const validator = {
|
|
|
createPage: [
|
|
createPage: [
|
|
|
- body('body').exists().not().isEmpty({ ignore_whitespace: true })
|
|
|
|
|
- .withMessage('body is required'),
|
|
|
|
|
|
|
+ body('body').exists()
|
|
|
|
|
+ .withMessage('body is re quired but an empty string is allowed'),
|
|
|
body('path').exists().not().isEmpty({ ignore_whitespace: true })
|
|
body('path').exists().not().isEmpty({ ignore_whitespace: true })
|
|
|
.withMessage('path is required'),
|
|
.withMessage('path is required'),
|
|
|
body('grant').if(value => value != null).isInt({ min: 0, 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'),
|