@droppii-org/chat-sdk
Version:
Droppii React Chat SDK
19 lines (18 loc) • 713 B
JavaScript
import { useMutation } from "@tanstack/react-query";
import { QUERY_KEYS } from "../../services/query";
import { apiInstance } from "../../services/api";
import { ENDPOINTS } from "../../services/routes";
import useAuthStore from "../../store/auth";
export const useUpdateNote = () => useMutation({
mutationKey: [QUERY_KEYS.UPDATE_NOTE],
mutationFn: async ({ noteId, content, }) => {
const res = await apiInstance.put(ENDPOINTS.chatService.updateNote(noteId), {
content,
}, {
params: {
applicationType: useAuthStore.getState().applicationType,
},
});
return res === null || res === void 0 ? void 0 : res.data;
},
});