UNPKG

@replyke/core

Version:

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

17 lines 740 B
import { useCallback } from "react"; import useAxiosPrivate from "../../../config/useAxiosPrivate"; import useProject from "../../projects/useProject"; function useDeleteConversation() { const { projectId } = useProject(); const axios = useAxiosPrivate(); const deleteConversation = useCallback(async ({ conversationId }) => { if (!projectId) throw new Error("No projectId available."); if (!conversationId) throw new Error("Please pass a conversationId."); await axios.delete(`/${projectId}/chat/conversations/${conversationId}`); }, [projectId, axios]); return deleteConversation; } export default useDeleteConversation; //# sourceMappingURL=useDeleteConversation.js.map