Fix discard workflow draft (#12230)

Fixes https://github.com/twentyhq/core-team-issues/issues/997

Fetch workflow id in workflow version is not done by default since the
refacto of relations. So we delete the version from cache once discarded
by we cannot clean the workflow using the workflow id in the version.

This PR adds the workflow id to the query.

Before


https://github.com/user-attachments/assets/03663bba-6c9e-4357-9326-0fb33c707fe6

After


https://github.com/user-attachments/assets/e6bb910b-2d9f-412f-a349-cd4b076aca65
This commit is contained in:
Thomas Trompette
2025-05-23 10:17:18 +02:00
committed by GitHub
parent 051f0fc83f
commit cced069d28

View File

@ -18,7 +18,17 @@ export const useWorkflowWithCurrentVersion = (
name: true,
statuses: true,
lastPublishedVersionId: true,
versions: true,
versions: {
id: true,
status: true,
name: true,
steps: true,
trigger: true,
workflowId: true,
deletedAt: true,
createdAt: true,
updatedAt: true,
},
},
skip: !isDefined(workflowId),
});