Chore/slice workflow (#18351)

This commit is contained in:
zxhlyh
2025-04-18 13:59:12 +08:00
committed by GitHub
parent 523efbfea5
commit efe5db38ee
44 changed files with 1855 additions and 1239 deletions

View File

@@ -21,10 +21,14 @@ export const useAppWorkflow = (appID: string) => {
})
}
export const useWorkflowConfig = (appId: string) => {
export const useWorkflowConfig = (appId: string, onSuccess: (v: WorkflowConfigResponse) => void) => {
return useQuery({
queryKey: [NAME_SPACE, 'config', appId],
queryFn: () => get<WorkflowConfigResponse>(`/apps/${appId}/workflows/draft/config`),
queryFn: async () => {
const data = await get<WorkflowConfigResponse>(`/apps/${appId}/workflows/draft/config`)
onSuccess(data)
return data
},
})
}