Parcourir la source

fix validation

zahmis il y a 5 ans
Parent
commit
631b48509d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/server/routes/apiv3/slack-bot-setting.js

+ 2 - 2
src/server/routes/apiv3/slack-bot-setting.js

@@ -23,8 +23,8 @@ module.exports = (crowi) => {
 
 
   const validator = {
   const validator = {
     CusotmBotSettings: [
     CusotmBotSettings: [
-      body('slackSigningSecret').exists().not().isEmpty({ ignore_whitespace: true }),
-      body('slackBotToken').exists().not().isEmpty({ ignore_whitespace: true }),
+      body('slackSigningSecret').if(value => value != null).isString(),
+      body('slackBotToken').if(value => value != null).isString(),
     ],
     ],
   };
   };