- API/WS clients: same-origin by default, drop dead imphnen hardcode
- chatbot history: map BE rows {user_message,bot_response,created_at}
- message_deleted WS payload: object {id,deleted_at}, not bare string
- dashboard: wire top-channels chart + live mod queue from /api/review,
add Users & Channels tabs consuming /api/dashboard/users|channels
- recordings: live WS sync via voice_recording_uploaded; duration_bytes optional
- remove dead widgets with no BE data source (trend chart, heatmap)
15 lines
411 B
TypeScript
15 lines
411 B
TypeScript
import type { ChatbotHistoryRow, ChatbotResponse } from "@/lib/types";
|
|
import { api } from "./client";
|
|
|
|
export const chatbotApi = {
|
|
send: (message: string) =>
|
|
api.post<ChatbotResponse>("/api/chat", { message }),
|
|
|
|
getHistory: () =>
|
|
api.get<{ history: ChatbotHistoryRow[]; total: number }>(
|
|
"/api/chat/history",
|
|
),
|
|
|
|
clearHistory: () => api.delete<{ ok: boolean }>("/api/chat/history"),
|
|
};
|