zzz / frontend /src /hooks /mutation /use-update-conversation.ts
ar08's picture
Upload 1040 files
246d201 verified
raw
history blame contribute delete
602 Bytes
import { useQueryClient, useMutation } from "@tanstack/react-query";
import OpenHands from "#/api/open-hands";
import { Conversation } from "#/api/open-hands.types";
export const useUpdateConversation = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (variables: {
id: string;
conversation: Partial<Omit<Conversation, "id">>;
}) =>
OpenHands.updateUserConversation(variables.id, variables.conversation),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["user", "conversations"] });
},
});
};