Răsfoiți Sursa

fix validation

Shun Miyazawa 4 ani în urmă
părinte
comite
0c3d508dc8
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      packages/app/src/server/routes/apiv3/pages.js

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

@@ -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'),