Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Continue integration frontend refactor
Tuan Dang397c15d61eb0
diff --git a/frontend/pages/api/bot/getBot.ts b/frontend/pages/api/bot/getBot.tsindex 6621dbe2fa..145b50891d 100644--- a/frontend/pages/api/bot/getBot.ts+++ b/frontend/pages/api/bot/getBot.ts@@ -21,7 +21,7 @@ const getBot = async ({ workspaceId }: Props) => {}).then(async (res) => {if (res && res.status == 200) {- return await res.json();+ return (await res.json()).bot;} else {console.log("Failed to get bot for project");}diff --git a/frontend/pages/integrations/[id].js b/frontend/pages/integrations/[id].jsindex 6ffccac905..0aa5df5e05 100644--- a/frontend/pages/integrations/[id].js+++ b/frontend/pages/integrations/[id].js@@ -23,8 +23,8 @@ const {const crypto = require("crypto");export default function Integrations() {- const [projectIntegrations, setProjectIntegrations] = useState([]);- const [authorizations, setAuthorizations] = useState();+ const [integrationAuths, setIntegrationAuths] = useState([]);+ const [integrations, setIntegrations] = useState([]);const [bot, setBot] = useState(null);const [isActivateBotOpen, setIsActivateBotOpen] = useState(false);const [selectedIntegrationOption, setSelectedIntegrationOption] = useState(null);@@ -33,23 +33,20 @@ export default function Integrations() {useEffect(async () => {try {- // get integrations authorized for project- let projectAuthorizations = await getWorkspaceAuthorizations({+ // get project integration authorizations+ setIntegrationAuths(await getWorkspaceAuthorizations({workspaceId: router.query.id,- });- setAuthorizations(projectAuthorizations);+ }));- // get active/inactive (cloud) integrations for project- const projectIntegrations = await getWorkspaceIntegrations({+ // get project integrations+ setIntegrations(await getWorkspaceIntegrations({workspaceId: router.query.id,- });- setProjectIntegrations(projectIntegrations);+ }));- // get bot for project- const bot = await getBot({+ // get project bot+ setBot(await getBot({workspaceId: router.query.id- });- setBot(bot.bot);+ }));} catch (err) {console.log(err);@@ -170,18 +167,18 @@ export default function Integrations() {handleBotActivate={handleBotActivate}handleIntegrationOption={handleIntegrationOption}/>- {projectIntegrations.length > 0 && (+ {integrations.length > 0 && ( // shouldn't need to check for length<ProjectIntegrationSection- projectIntegrations={projectIntegrations}+ projectIntegrations={integrations}/>)}<CloudIntegrationSection- projectIntegrations={projectIntegrations}+ projectIntegrations={integrations}integrations={cloudIntegrations}setSelectedIntegrationOption={setSelectedIntegrationOption}integrationOptionPress={integrationOptionPress}deleteIntegrationAuth={deleteIntegrationAuth}- authorizations={authorizations}+ authorizations={integrationAuths}/><FrameworkIntegrationSectionframeworks={frameworkIntegrations}