(workspaceId?: string, options?: { scope?: WorkflowQueryScope })
| 128 | * with structural sharing — components only re-render when the record changes. |
| 129 | */ |
| 130 | export function useWorkflowMap(workspaceId?: string, options?: { scope?: WorkflowQueryScope }) { |
| 131 | const { scope = 'active' } = options || {} |
| 132 | |
| 133 | return useQuery({ |
| 134 | queryKey: workflowKeys.list(workspaceId, scope), |
| 135 | queryFn: workspaceId ? getWorkflowListQueryOptions(workspaceId, scope).queryFn : skipToken, |
| 136 | placeholderData: keepPreviousData, |
| 137 | staleTime: WORKFLOW_LIST_STALE_TIME, |
| 138 | select: selectWorkflowMap, |
| 139 | }) |
| 140 | } |
| 141 | |
| 142 | interface CreateWorkflowVariables { |
| 143 | workspaceId: string |
no test coverage detected