소스 검색

modify try catch in testConnection

zahmis 5 년 전
부모
커밋
bccc3f904c
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

+ 4 - 4
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -69,16 +69,16 @@ const CustomBotWithoutProxySettingsAccordion = ({
     setConnectionSuccessMessage(null);
     // TODO: 5921 Add new Test endpoint
     try {
-      const res = await appContainer.apiv3.post('/slack-integration-settings/without-proxy/test', {
+      await appContainer.apiv3.post('/slack-integration-settings/without-proxy/test', {
         channel: testChannel,
       });
-      setConnectionSuccessMessage(res.data.message);
+      setConnectionSuccessMessage('Send to message to slack ws.');
       onSetIsSendTestMessage(true);
     }
     catch (err) {
       onSetIsSendTestMessage(false);
-      setConnectionErrorCode('dummy-error-code');
-      setConnectionErrorMessage('This is a sample error message');
+      setConnectionErrorCode(err[0].code);
+      setConnectionErrorMessage(err[0].message);
     }
   };