Files
twenty/packages/twenty-front/src/modules/workflow/hooks/useWorkflowRunUnsafe.ts
Baptiste Devessier 8bd9bc9d31 Make the frontend resilient to old workflow run output formats (#10522)
- Create zod schemas for everything related to a workflow run
- Update the types to be inferred from the zod schemas
- Improper workflow run outputs will render a blank screen; we could
show an error in the future



https://github.com/user-attachments/assets/8e666c3e-82b0-4ab5-8804-2f70130ea257
2025-02-27 10:36:19 +01:00

17 lines
491 B
TypeScript

import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { WorkflowRun } from '@/workflow/types/Workflow';
export const useWorkflowRunUnsafe = ({
workflowRunId,
}: {
workflowRunId: string;
}) => {
const { record } = useFindOneRecord<WorkflowRun>({
objectNameSingular: CoreObjectNameSingular.WorkflowRun,
objectRecordId: workflowRunId,
});
return record;
};