zahmis 4 лет назад
Родитель
Сommit
a2383de573

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

@@ -51,7 +51,6 @@ const SlackIntegration = (props) => {
 
   const resetWithOutSettings = async() => {
     try {
-      await appContainer.apiv3.delete('/slack-integration-settings/bot-type');
       await appContainer.apiv3.put('/slack-integration-settings/bot-type', { currentBotType: 'customBotWithoutProxy' });
       fetchSlackIntegrationData();
       toastSuccess(t('admin:slack_integration.bot_reset_successful'));

+ 0 - 30
src/server/routes/apiv3/slack-integration-settings.js

@@ -274,36 +274,6 @@ module.exports = (crowi) => {
       }
     });
 
-  router.put('/update-settings', async(req, res) => {
-    if (req.body.currentBotType === 'customBotWithoutProxy') {
-      const { slackSigningSecret, slackBotToken, currentBotType } = req.body;
-      const requestParams = {
-        'slackbot:signingSecret': slackSigningSecret,
-        'slackbot:token': slackBotToken,
-        'slackbot:currentBotType': currentBotType,
-      };
-      try {
-        await updateSlackBotSettings(requestParams);
-        crowi.slackBotService.publishUpdatedMessage();
-
-        // TODO Impl to delete AccessToken both of Proxy and GROWI when botType changes.
-        const customBotWithoutProxySettingParams = {
-          slackSigningSecret: crowi.configManager.getConfig('crowi', 'slackbot:signingSecret'),
-          slackBotToken: crowi.configManager.getConfig('crowi', 'slackbot:token'),
-          slackBotType: crowi.configManager.getConfig('crowi', 'slackbot:currentBotType'),
-        };
-        return res.apiv3({ customBotWithoutProxySettingParams });
-      }
-      catch (error) {
-        const msg = 'Error occured in updating Custom bot setting';
-        logger.error('Error', error);
-        return res.apiv3Err(new ErrorV3(msg, 'update-CustomBotSetting-failed'), 500);
-      }
-    }
-    else {
-      // TODO imple other botType action
-    }
-  });
 
   /**
    * @swagger