UNPKG

@droppii-org/chat-sdk

Version:

Droppii React Chat SDK

16 lines (15 loc) 689 B
import { useQuery } 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 useGetSessionSummary = () => useQuery({ queryKey: [QUERY_KEYS.GET_SESSION_SUMMARY], queryFn: async () => { var _a; const res = await apiInstance.post(ENDPOINTS.chatService.getSessionSummary, { applicationType: useAuthStore.getState().applicationType, }); return (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data; }, });