Reduce page reloads for integrations page

This commit is contained in:
Tuan Dang
2023-01-18 17:38:52 +07:00
parent 3a6b2084bc
commit 06803519e6
6 changed files with 100 additions and 40 deletions
@@ -17,7 +17,7 @@ const deleteIntegration = ({ integrationId }: Props) =>
}
}).then(async (res) => {
if (res && res.status === 200) {
return (await res.json()).workspace;
return (await res.json()).integration;
}
console.log('Failed to delete an integration');
return undefined;
@@ -50,7 +50,7 @@ const updateIntegration = ({
})
}).then(async (res) => {
if (res && res.status === 200) {
return res;
return (await res.json()).integration;
}
console.log('Failed to start an integration');
return undefined;
+7 -1
View File
@@ -226,7 +226,13 @@ export default function Integrations() {
handleBotActivate={handleBotActivate}
handleIntegrationOption={handleIntegrationOption}
/> */}
<IntegrationSection integrations={integrations} environments={environments} />
<IntegrationSection
integrations={integrations}
setIntegrations={setIntegrations}
bot={bot}
setBot={setBot}
environments={environments}
/>
{cloudIntegrationOptions.length > 0 && bot ? (
<CloudIntegrationSection
cloudIntegrationOptions={cloudIntegrationOptions}