Files
twenty/packages/twenty-front/src/modules/workflow/hooks/useWorkflowVersionIdOrThrow.ts
T
Thomas Trompette 50c4c50169 Remove workflow context + clean action config (#13919)
- Remove create related version and runs from workflow action config
- Remove WorkflowStepContextProvider. Use states instead
2025-08-14 10:17:07 +00:00

16 lines
608 B
TypeScript

import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { workflowVisualizerWorkflowVersionIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowVersionIdComponentState';
import { isDefined } from 'twenty-shared/utils';
export const useWorkflowVersionIdOrThrow = () => {
const workflowVersionId = useRecoilComponentValue(
workflowVisualizerWorkflowVersionIdComponentState,
);
if (!isDefined(workflowVersionId)) {
throw new Error('Expected the workflow version ID to be defined');
}
return workflowVersionId;
};