Skip to content

The open alternative to Salesforce, designed for AI.

Remove buggy refetch query (#9420)

martmull1691fa5065cd
diff --git a/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts b/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts
index 0c028457029..ffc337d24af 100644
--- a/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts
+++ b/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts
@@ -1,8 +1,6 @@
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { UPDATE_ONE_SERVERLESS_FUNCTION } from '@/settings/serverless-functions/graphql/mutations/updateOneServerlessFunction';
-import { FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE } from '@/settings/serverless-functions/graphql/queries/findOneServerlessFunctionSourceCode';
import { useMutation } from '@apollo/client';
-import { getOperationName } from '@apollo/client/utilities';
import {
UpdateOneServerlessFunctionMutation,
UpdateOneServerlessFunctionMutationVariables,
@@ -31,10 +29,6 @@ export const useUpdateOneServerlessFunction = (
variables: {
input: { ...input, id: serverlessFunctionId },
},
- awaitRefetchQueries: true,
- refetchQueries: [
- getOperationName(FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE) ?? '',
- ],
});
setIsReady(false);
return result;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx
index 5b843afe41e..fb76b0fc610 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx
@@ -77,9 +77,8 @@ export const WorkflowEditActionFormServerlessFunction = ({
}: WorkflowEditActionFormServerlessFunctionProps) => {
const serverlessFunctionId = action.settings.input.serverlessFunctionId;
const theme = useTheme();
- const { activeTabId, setActiveTabId } = useTabList(
- WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID,
- );
+ const tabListId = `${WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID}_${serverlessFunctionId}`;
+ const { activeTabId, setActiveTabId } = useTabList(tabListId);
const { updateOneServerlessFunction, isReady } =
useUpdateOneServerlessFunction(serverlessFunctionId);
const { getUpdatableWorkflowVersion } = useGetUpdatableWorkflowVersion();
@@ -269,9 +268,7 @@ export const WorkflowEditActionFormServerlessFunction = ({
<StyledContainer>
<StyledTabListContainer>
<TabList
- tabListInstanceId={
- WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID
- }
+ tabListInstanceId={tabListId}
tabs={tabs}
behaveAsLinks={false}
/>