2
0
Эх сурвалжийг харах

Edited to match with config-loader

Steven Fukase 5 жил өмнө
parent
commit
6aeb5ecd05

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

@@ -45,7 +45,9 @@ module.exports = (crowi) => {
       body('botType').isString(),
     ],
     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 requestParams = {
-        'slackbot:currentBotType': currentBotType,
+        'slackbot:type': currentBotType,
       };
 
       try {
         await updateSlackBotSettings(requestParams);
         const slackIntegrationSettingsParams = {
-          currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:currentBotType'),
+          currentBotType: crowi.configManager.getConfig('crowi', 'slackbot:type'),
         };
         return res.apiv3({ slackIntegrationSettingsParams });
       }