Fix workflow with manual triggers and no selection not appearing in the command menu (#11544)
Fix workflow with manual triggers and no selection not appearing in the command menu --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -3,7 +3,7 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { Workflow, WorkflowVersion } from '@/workflow/types/Workflow';
|
||||
|
||||
export const useActiveWorkflowVersion = (workflowId: string) => {
|
||||
const { records: workflowVersions } = useFindManyRecords<
|
||||
const { records: workflowVersions, loading } = useFindManyRecords<
|
||||
WorkflowVersion & {
|
||||
workflow: Omit<Workflow, 'versions'> & {
|
||||
versions: Array<{ __typename: string }>;
|
||||
@ -39,5 +39,8 @@ export const useActiveWorkflowVersion = (workflowId: string) => {
|
||||
},
|
||||
});
|
||||
|
||||
return workflowVersions?.[0];
|
||||
return {
|
||||
workflowVersion: workflowVersions?.[0],
|
||||
loading,
|
||||
};
|
||||
};
|
||||
|
||||
@ -8,8 +8,10 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
objectMetadataItem,
|
||||
skip,
|
||||
}: {
|
||||
objectMetadataItem?: ObjectMetadataItem;
|
||||
skip?: boolean;
|
||||
}) => {
|
||||
const filters = [
|
||||
{
|
||||
@ -50,6 +52,7 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
}),
|
||||
workflow: true,
|
||||
},
|
||||
skip,
|
||||
});
|
||||
|
||||
// TODO: refactor when we can use 'not like' in the RawJson filter
|
||||
|
||||
Reference in New Issue
Block a user