mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
chore: add invalid all built in tools
This commit is contained in:
parent
5c98d80fdf
commit
edbfe27eb1
|
@ -12,13 +12,24 @@ import {
|
|||
|
||||
const NAME_SPACE = 'tools'
|
||||
|
||||
const useAllBuiltInToolsKey = [NAME_SPACE, 'builtIn']
|
||||
export const useAllBuiltInTools = () => {
|
||||
return useQuery<ToolWithProvider[]>({
|
||||
queryKey: [NAME_SPACE, 'builtIn'],
|
||||
queryKey: useAllBuiltInToolsKey,
|
||||
queryFn: () => get<ToolWithProvider[]>('/workspaces/current/tools/builtin'),
|
||||
})
|
||||
}
|
||||
|
||||
export const useInvalidateAllBuiltInTools = () => {
|
||||
const queryClient = useQueryClient()
|
||||
return () => {
|
||||
queryClient.invalidateQueries(
|
||||
{
|
||||
queryKey: useAllBuiltInToolsKey,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const useAllCustomToolsKey = [NAME_SPACE, 'customTools']
|
||||
export const useAllCustomTools = () => {
|
||||
return useQuery<ToolWithProvider[]>({
|
||||
|
|
Loading…
Reference in New Issue
Block a user