zahmis 5 лет назад
Родитель
Сommit
e5ae8f4559

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

@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
 import { Collapse } from 'reactstrap';
 import AppContainer from '../../../services/AppContainer';
 import { withUnstatedContainers } from '../../UnstatedUtils';
+import { toastSuccess } from '../../../util/apiNotification';
 
 const CustomBotWithoutProxySettingsAccordion = (props) => {
   const { appContainer } = props;
@@ -11,7 +12,7 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
   const [openAccordionIndexes, setOpenAccordionIndexes] = useState(new Set());
   const [connectionErrorCode, setConnectionErrorCode] = useState(null);
   const [connectionErrorMessage, setConnectionErrorMessage] = useState(null);
-  const [connectionSuccessMessage, setConnectionSuccessMessage] = useState(null);
+  // const [connectionSuccessMessage, setConnectionSuccessMessage] = useState(null);
   const [testChannel, setTestChannel] = useState('');
 
   const onToggleAccordionHandler = (i) => {
@@ -28,14 +29,13 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
   const onTestConnectionHandler = async() => {
     setConnectionErrorCode(null);
     setConnectionErrorMessage(null);
-    setConnectionSuccessMessage(null);
+    // setConnectionSuccessMessage(null);
     try {
       const res = await appContainer.apiv3.post('slack-integration/notification-test-to-slack-work-space', {
         // TODO put proper request
         channel: testChannel,
       });
-      console.log(res.data.message);
-      setConnectionSuccessMessage(res.data.message);
+      toastSuccess(res.data.message);
     }
     catch (err) {
       setConnectionErrorCode(err[0].code);
@@ -183,7 +183,6 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
                 <div className="card border-info slack-connection-error-log-body rounded-lg px-5 py-4">
                   <p className="m-0">{connectionErrorCode}</p>
                   <p className="m-0">{connectionErrorMessage}</p>
-                  <p className="m-0">{connectionSuccessMessage}</p>
                 </div>
               </div>
             </div>