Download src/hooks/mutation/use-delete-agent-profile.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 660 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/hooks/mutation/use-delete-agent-profile.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/hooks/mutation/use-delete-agent-profile.ts
-
curl -L -o use-delete-agent-profile.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/hooks/mutation/use-delete-agent-profile.ts
660 Bytes
| import { useMutation, useQueryClient } from "@tanstack/react-query"; | |
| import AgentProfilesService from "#/api/agent-profiles-service/agent-profiles-service.api"; | |
| import { AGENT_PROFILES_QUERY_KEYS } from "#/hooks/query/query-keys"; | |
| export function useDeleteAgentProfile() { | |
| const queryClient = useQueryClient(); | |
| return useMutation({ | |
| mutationFn: (name: string) => AgentProfilesService.deleteProfile(name), | |
| onSuccess: async () => { | |
| await queryClient.invalidateQueries({ | |
| queryKey: AGENT_PROFILES_QUERY_KEYS.all, | |
| }); | |
| }, | |
| // Consumers handle errors with try-catch and manual toasts. | |
| meta: { disableToast: true }, | |
| }); | |
| } | |