Przeglądaj źródła

Edited to match with config-loader

Steven Fukase 5 lat temu
rodzic
commit
6aeb5ecd05
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      src/server/routes/apiv3/slack-integration.js

+ 5 - 3
src/server/routes/apiv3/slack-integration.js

@@ -45,7 +45,9 @@ module.exports = (crowi) => {
       body('botType').isString(),
       body('botType').isString(),
     ],
     ],
     SlackIntegration: [
     SlackIntegration: [
-      body('currentBotType').isString(),
+      body('currentBotType') === 'official-bot'
+      || body('currentBotType') === 'custom-bot-without-proxy'
+      || body('currentBotType') === 'custom-bot-with-proxy',
     ],
     ],
   };
   };
 
 
@@ -104,13 +106,13 @@ module.exports = (crowi) => {
       const { currentBotType } = req.body;
       const { currentBotType } = req.body;
 
 
       const requestParams = {
       const requestParams = {
-        'slackbot:currentBotType': currentBotType,
+        'slackbot:type': currentBotType,
       };
       };
 
 
       try {
       try {
         await updateSlackBotSettings(requestParams);
         await updateSlackBotSettings(requestParams);
         const slackIntegrationSettingsParams = {
         const slackIntegrationSettingsParams = {
-          currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:currentBotType'),
+          currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:type'),
         };
         };
         return res.apiv3({ slackIntegrationSettingsParams });
         return res.apiv3({ slackIntegrationSettingsParams });
       }
       }