Browse Source

fix endopoint

zahmis 5 years ago
parent
commit
bf21f18737
1 changed files with 18 additions and 3 deletions
  1. 18 3
      src/server/routes/apiv3/slack-bot-setting.js

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

@@ -63,11 +63,26 @@ module.exports = (crowi) => {
    *          200:
    *          200:
    *            description: Succeeded to get SigningSecret and SlackBotToken.
    *            description: Succeeded to get SigningSecret and SlackBotToken.
    */
    */
-  router.get('/custom-bot-setting', accessTokenParser, loginRequiredStrictly, adminRequired, async(req, res) => {
+  router.get('/', accessTokenParser, loginRequiredStrictly, adminRequired, async(req, res) => {
 
 
     const slackBotSettingParams = {
     const slackBotSettingParams = {
-      slackSigningSecret: await crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
-      slackBotToken: await crowi.configManager.getConfig('crowi', 'slackbot:token'),
+
+      generalSlackBot: {
+        isCustomNonProxyEnabled: await crowi.configManager.getConfig('crowi', ''),
+        // isCustomWithProxyEnabled: ,
+        // isOfficialEnabled: ,
+      },
+      // TODO impl when creating official bot
+      // officialBotSettings: {
+      // },
+      cusotmBotSettingsNonProxy: {
+        slackSigningSecret: await crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
+        slackBotToken: await crowi.configManager.getConfig('crowi', 'slackbot:token'),
+      },
+      // TODO imple when creating with proxy
+      // cusotmBotSettingsWithProxy: {
+      // },
+
     };
     };
     return res.apiv3({ slackBotSettingParams });
     return res.apiv3({ slackBotSettingParams });
   });
   });