diff --git a/web/service/use-tools.ts b/web/service/use-tools.ts index 3c34de3be9..ee2af1f398 100644 --- a/web/service/use-tools.ts +++ b/web/service/use-tools.ts @@ -12,13 +12,24 @@ import { const NAME_SPACE = 'tools' +const useAllBuiltInToolsKey = [NAME_SPACE, 'builtIn'] export const useAllBuiltInTools = () => { return useQuery({ - queryKey: [NAME_SPACE, 'builtIn'], + queryKey: useAllBuiltInToolsKey, queryFn: () => get('/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({