mirror of
https://github.com/QuivrHQ/quivr.git
synced 2025-01-05 14:54:25 +03:00
d51d4a1e90
* refactor: add addQuestion to chat api * test(chat): add unit tests to addQuestion
23 lines
619 B
TypeScript
23 lines
619 B
TypeScript
import { useAxios } from "@/lib/hooks";
|
|
|
|
import {
|
|
addQuestion,
|
|
AddQuestionParams,
|
|
createChat,
|
|
deleteChat,
|
|
getChats,
|
|
} from "./chat";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useChatApi = () => {
|
|
const { axiosInstance } = useAxios();
|
|
|
|
return {
|
|
createChat: async (chatName: string) => createChat(chatName, axiosInstance),
|
|
getChats: async () => getChats(axiosInstance),
|
|
deleteChat: async (chatId: string) => deleteChat(chatId, axiosInstance),
|
|
addQuestion: async (props: AddQuestionParams) =>
|
|
addQuestion(props, axiosInstance),
|
|
};
|
|
};
|