Files
dify/web/app/components/workflow/plugin-dependency/hooks.ts
T
3c014f3ae5 Feat/plugins (#12547)
Co-authored-by: AkaraChen <[email protected]>
Co-authored-by: Yi <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: JzoNg <[email protected]>
Co-authored-by: twwu <[email protected]>
Co-authored-by: kurokobo <[email protected]>
Co-authored-by: Hiroshi Fujita <[email protected]>
2025-01-09 18:47:41 +08:00

18 lines
598 B
TypeScript

import { useCallback } from 'react'
import { useStore as usePluginDependenciesStore } from './store'
import { useMutationCheckDependencies } from '@/service/use-plugins'
export const usePluginDependencies = () => {
const { mutateAsync } = useMutationCheckDependencies()
const handleCheckPluginDependencies = useCallback(async (appId: string) => {
const { leaked_dependencies } = await mutateAsync(appId)
const { setDependencies } = usePluginDependenciesStore.getState()
setDependencies(leaked_dependencies)
}, [mutateAsync])
return {
handleCheckPluginDependencies,
}
}