Skip to content

Commit 80c40ba

Browse files
committed
Fix execute transition ignoring failed conditions
1 parent 8f3022f commit 80c40ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/workflow/workflow.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ export const WorkflowService = <W extends Workflow>(workflow: () => W) => {
150150
return WorkflowServiceClass;
151151
};
152152

153-
export const findTransition = <T extends { key: ID }>(
153+
export const findTransition = <T extends { key: ID; disabled?: boolean }>(
154154
transitions: readonly T[],
155155
needle: ExecuteTransitionInput['transition'],
156156
) => {
157-
const transition = transitions.find((t) => t.key === needle);
157+
const transition = transitions.find((t) => t.key === needle && !t.disabled);
158158
if (!transition) {
159159
throw new UnauthorizedException('This transition is not available');
160160
}

0 commit comments

Comments
 (0)