فهرست منبع

fix validator

kaori 4 سال پیش
والد
کامیت
5ae5962017

+ 0 - 2
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -86,8 +86,6 @@ const SlackIntegration = (props) => {
   const changeCurrentBotSettingsHandler = async() => {
     try {
       const res = await appContainer.apiv3.put('/slack-integration-settings/bot-type', {
-        slackSigningSecret: '',
-        slackBotToken: '',
         currentBotType: selectedBotType,
       });
       setCurrentBotType(res.data.slackBotTypeParam.slackBotType);

+ 2 - 4
src/server/routes/apiv3/slack-integration-settings.js

@@ -47,9 +47,7 @@ module.exports = (crowi) => {
   const apiV3FormValidator = require('../../middlewares/apiv3-form-validator')(crowi);
 
   const validator = {
-    CustomBotWithoutProxy: [
-      body('slackSigningSecret').isString(),
-      body('slackBotToken').isString(),
+    BotType: [
       body('currentBotType').isString(),
     ],
     SlackIntegration: [
@@ -188,7 +186,7 @@ module.exports = (crowi) => {
    *             description: Succeeded to put CustomBotWithoutProxy setting.
    */
   router.put('/bot-type',
-    accessTokenParser, loginRequiredStrictly, adminRequired, csrf, validator.CustomBotWithoutProxy, apiV3FormValidator, async(req, res) => {
+    accessTokenParser, loginRequiredStrictly, adminRequired, csrf, validator.BotType, apiV3FormValidator, async(req, res) => {
       const { currentBotType } = req.body;
 
       await resetAllBotSettings();