Explorar o código

fix validation not isIn use

zahmis %!s(int64=5) %!d(string=hai) anos
pai
achega
90cee13658

+ 1 - 1
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -35,7 +35,7 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
         // TODO put proper request
         channel: testChannel,
       });
-      toastSuccess(res.data.message);
+      toastSuccess(`Successfuly send message #${testChannel}.`);
     }
     catch (err) {
       setConnectionErrorCode(err[0].code);

+ 1 - 1
src/server/routes/apiv3/slack-integration.js

@@ -57,7 +57,7 @@ module.exports = (crowi) => {
         .isIn(['official-bot', 'custom-bot-without-proxy', 'custom-bot-with-proxy']),
     ],
     NotificationTestToSlackWorkSpace: [
-      body('channel').isString(),
+      body('channel').not().isIn(['']).isString(),
     ],
   };