mirror of https://github.com/langgenius/dify.git
fix: plugins task permission (#13330)
This commit is contained in:
parent
a8a8a5513c
commit
7e1d9894fb
|
|
@ -29,6 +29,7 @@ import {
|
|||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
import { useInvalidateAllBuiltInTools } from './use-tools'
|
||||
import usePermission from '@/app/components/plugins/plugin-page/use-permission'
|
||||
|
||||
const NAME_SPACE = 'plugins'
|
||||
|
||||
|
|
@ -356,12 +357,16 @@ export const useFetchPluginsInMarketPlaceByInfo = (infos: Record<string, any>[])
|
|||
|
||||
const usePluginTaskListKey = [NAME_SPACE, 'pluginTaskList']
|
||||
export const usePluginTaskList = () => {
|
||||
const {
|
||||
canManagement,
|
||||
} = usePermission()
|
||||
const {
|
||||
data,
|
||||
isFetched,
|
||||
refetch,
|
||||
...rest
|
||||
} = useQuery({
|
||||
enabled: canManagement,
|
||||
queryKey: usePluginTaskListKey,
|
||||
queryFn: () => get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100'),
|
||||
refetchInterval: (lastQuery) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue