Fix refetch on workflow status update (#9946)

Refetch was not set-up properly on activation/deactivation
This commit is contained in:
Thomas Trompette
2025-01-31 11:19:53 +01:00
committed by GitHub
parent 502891a430
commit 4e32fd1c98
7 changed files with 26 additions and 12 deletions

View File

@ -122,9 +122,10 @@ export const RecordShowPageWorkflowHeader = ({
workflowWithCurrentVersion,
);
return deactivateWorkflowVersion(
workflowWithCurrentVersion.currentVersion.id,
);
return deactivateWorkflowVersion({
workflowVersionId: workflowWithCurrentVersion.currentVersion.id,
workflowId: workflowWithCurrentVersion.id,
});
}}
/>
) : null}

View File

@ -130,7 +130,10 @@ export const RecordShowPageWorkflowVersionHeader = ({
Icon={IconPlayerStop}
disabled={isWaitingForWorkflowVersion}
onClick={() => {
return deactivateWorkflowVersion(workflowVersion.id);
return deactivateWorkflowVersion({
workflowVersionId: workflowVersion.id,
workflowId: workflowVersion.workflowId,
});
}}
/>
) : null}

View File

@ -37,7 +37,7 @@ export const useActivateWorkflowVersion = () => {
{
query: findManyWorkflowVersionsQuery,
variables: {
id: workflowId,
workflowId,
},
},
],

View File

@ -22,7 +22,13 @@ export const useDeactivateWorkflowVersion = () => {
objectNameSingular: CoreObjectNameSingular.WorkflowVersion,
});
const deactivateWorkflowVersion = async (workflowVersionId: string) => {
const deactivateWorkflowVersion = async ({
workflowVersionId,
workflowId,
}: {
workflowVersionId: string;
workflowId: string;
}) => {
await mutate({
variables: {
workflowVersionId,
@ -31,7 +37,7 @@ export const useDeactivateWorkflowVersion = () => {
{
query: findManyWorkflowVersionsQuery,
variables: {
id: workflowVersionId,
workflowId,
},
},
],