UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

18 lines 777 B
import { useCallback } from "react"; import useAxiosPrivate from "../../../config/useAxiosPrivate"; import useProject from "../../projects/useProject"; function useUpdateConversation() { const { projectId } = useProject(); const axios = useAxiosPrivate(); const update = useCallback(async ({ conversationId, ...rest }) => { if (!projectId) throw new Error("No projectId available."); if (!conversationId) throw new Error("Please pass a conversationId."); const response = await axios.patch(`/${projectId}/chat/conversations/${conversationId}`, rest); return response.data; }, [projectId, axios]); return update; } export default useUpdateConversation; //# sourceMappingURL=useUpdateConversation.js.map