Просмотр исходного кода

connected delete btn to endpoint

Steven Fukase 4 лет назад
Родитель
Сommit
00ebcb6fc1

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

@@ -28,7 +28,7 @@ const CustomBotWithProxySettings = (props) => {
     // TODO GW-6067 implement
   };
 
-  const discardTokenHandler = async(tokenGtoP, tokenPtoG) => {
+  const deleteSlackAppIntegrationHandler = async(tokenGtoP, tokenPtoG) => {
     try {
       // GW-6068 set new value after this
       await appContainer.apiv3.delete('/slack-integration-settings/slack-app-integration', { tokenGtoP, tokenPtoG });
@@ -50,20 +50,6 @@ const CustomBotWithProxySettings = (props) => {
     }
   };
 
-  const deleteSlackAppIntegrationHandler = async() => {
-    try {
-      // TODO GW-5923 delete SlackAppIntegration
-      await appContainer.apiv3.delete('/slack-integration-settings', {
-        tokenGtoP,
-        tokenPtoG,
-      });
-      toastSuccess('success');
-    }
-    catch (err) {
-      toastError(err);
-    }
-  };
-
   const updateProxyUri = async() => {
     try {
       await appContainer.apiv3.put('/slack-integration-settings/proxy-uri', {
@@ -133,7 +119,6 @@ const CustomBotWithProxySettings = (props) => {
               </div>
               <WithProxyAccordions
                 botType="customBotWithProxy"
-                discardTokenHandler={() => discardTokenHandler(tokenGtoP, tokenPtoG)}
                 generateTokenHandler={generateTokenHandler}
                 tokenGtoP={tokenGtoP}
                 tokenPtoG={tokenPtoG}
@@ -169,7 +154,6 @@ CustomBotWithProxySettings.defaultProps = {
 
 CustomBotWithProxySettings.propTypes = {
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
-
   slackAppIntegrations: PropTypes.array,
   proxyServerUri: PropTypes.string,
 };

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

@@ -326,7 +326,6 @@ const OfficialBotSettingsAccordionsWrapper = withUnstatedContainers(WithProxyAcc
 WithProxyAccordions.propTypes = {
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   botType: PropTypes.string.isRequired,
-  discardTokenHandler: PropTypes.func,
   generateTokenHandler: PropTypes.func,
   tokenPtoG: PropTypes.string,
   tokenGtoP: PropTypes.string,