mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
fix: dsl check
This commit is contained in:
@ -24,7 +24,6 @@ import {
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
import { useStore as usePluginDependencyStore } from '@/app/components/workflow/plugin-dependency/store'
|
||||
import { useInvalidateAllBuiltInTools } from './use-tools'
|
||||
|
||||
const NAME_SPACE = 'plugins'
|
||||
@ -324,36 +323,6 @@ export const useMutationClearAllTaskPlugin = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export const useMutationCheckDependenciesBeforeImportDSL = () => {
|
||||
const mutation = useMutation({
|
||||
mutationFn: ({ dslString, url }: { dslString?: string, url?: string }) => {
|
||||
if (url) {
|
||||
return post<{ leaked: Dependency[] }>(
|
||||
'/apps/import/url/dependencies/check',
|
||||
{
|
||||
body: {
|
||||
url,
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
return post<{ leaked: Dependency[] }>(
|
||||
'/apps/import/dependencies/check',
|
||||
{
|
||||
body: {
|
||||
data: dslString,
|
||||
},
|
||||
})
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
const { setDependencies } = usePluginDependencyStore.getState()
|
||||
setDependencies(data.leaked || [])
|
||||
},
|
||||
})
|
||||
|
||||
return mutation
|
||||
}
|
||||
|
||||
export const useDownloadPlugin = (info: { organization: string; pluginName: string; version: string }, needDownload: boolean) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'downloadPlugin', info],
|
||||
|
||||
Reference in New Issue
Block a user