mirror of
https://github.com/langgenius/dify.git
synced 2026-02-18 13:01:00 -05:00
Merge branch 'main' into feat/support-agent-sandbox
This commit is contained in:
@@ -26,14 +26,26 @@ export const useAppWorkflow = (appID: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
const WorkflowRunHistoryKey = [NAME_SPACE, 'runHistory']
|
||||
|
||||
export const useWorkflowRunHistory = (url?: string, enabled = true) => {
|
||||
return useQuery<WorkflowRunHistoryResponse>({
|
||||
queryKey: [NAME_SPACE, 'runHistory', url],
|
||||
queryKey: [...WorkflowRunHistoryKey, url],
|
||||
queryFn: () => get<WorkflowRunHistoryResponse>(url as string),
|
||||
enabled: !!url && enabled,
|
||||
staleTime: 0,
|
||||
})
|
||||
}
|
||||
|
||||
export const useInvalidateWorkflowRunHistory = () => {
|
||||
const queryClient = useQueryClient()
|
||||
return (url: string) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [...WorkflowRunHistoryKey, url],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const useInvalidateAppWorkflow = () => {
|
||||
const queryClient = useQueryClient()
|
||||
return (appID: string) => {
|
||||
|
||||
Reference in New Issue
Block a user