Merge branch 'feat/plugins' of https://github.com/langgenius/dify into feat/plugins

This commit is contained in:
AkaraChen 2024-11-18 11:23:49 +08:00
commit 07494459cc
2 changed files with 3 additions and 6 deletions

View File

@ -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(() => {

View File

@ -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`),
})
}