handle params better

This commit is contained in:
Mutasem Aldmour 2024-10-30 15:46:53 +01:00
parent 6709fd3dde
commit 97109b0069
No known key found for this signature in database
GPG key ID: 3DFA8122BB7FD6B8

View file

@ -206,11 +206,13 @@ const fetchWorkflowsWithFilters = async () => {
const projectId =
typeof route.params?.projectId === 'string' ? route.params.projectId : homeProject;
const tagNames = tags.map((tagId) => tagsStore.tagsById[tagId]?.name);
// todo move to fetchAllWorkflows function
const options: WorkflowsFetchOptions = {
filter: {
projectId,
projectId: projectId?.length ? projectId : undefined,
active: status === StatusFilter.ACTIVE ? true : undefined,
tags: tags.map((tagId) => tagsStore.tagsById[tagId]?.name),
tags: tagNames.length ? tagNames : undefined,
},
credentialIds: credentials.length ? credentials : undefined,
nodeTypes: nodeTypes.length ? nodeTypes : undefined,