mirror of https://github.com/langgenius/dify.git
chore: enabled for useQuery
This commit is contained in:
parent
66f0e1209a
commit
afdfc8c609
|
|
@ -33,7 +33,7 @@ const AppInputsPanel = ({
|
|||
const isBasicApp = appDetail.mode !== 'advanced-chat' && appDetail.mode !== 'workflow'
|
||||
const { data: fileUploadConfig } = useFileUploadConfig()
|
||||
const { data: currentApp, isFetching: isAppLoading } = useAppDetail(appDetail.id)
|
||||
const { data: currentWorkflow, isFetching: isWorkflowLoading } = useAppWorkflow(isBasicApp ? 'empty' : appDetail.id)
|
||||
const { data: currentWorkflow, isFetching: isWorkflowLoading } = useAppWorkflow(isBasicApp ? '' : appDetail.id)
|
||||
const isLoading = isAppLoading || isWorkflowLoading
|
||||
|
||||
const basicAppFileConfig = useMemo(() => {
|
||||
|
|
|
|||
|
|
@ -8,11 +8,8 @@ const NAME_SPACE = 'workflow'
|
|||
|
||||
export const useAppWorkflow = (appID: string) => {
|
||||
return useQuery<FetchWorkflowDraftResponse>({
|
||||
enabled: !!appID,
|
||||
queryKey: [NAME_SPACE, 'publish', appID],
|
||||
queryFn: () => {
|
||||
if (appID === 'empty')
|
||||
return Promise.resolve({} as unknown as FetchWorkflowDraftResponse)
|
||||
return get<FetchWorkflowDraftResponse>(`/apps/${appID}/workflows/publish`)
|
||||
},
|
||||
queryFn: () => get<FetchWorkflowDraftResponse>(`/apps/${appID}/workflows/publish`),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue