2023-07-06 20:01:23 +03:00
|
|
|
import { useAxios } from "@/lib/hooks";
|
|
|
|
|
2023-07-07 13:56:08 +03:00
|
|
|
import {
|
|
|
|
createBrain,
|
|
|
|
deleteBrain,
|
|
|
|
getBrain,
|
|
|
|
getBrainDocuments,
|
|
|
|
getBrains,
|
|
|
|
getDefaultBrain,
|
|
|
|
} from "./brain";
|
2023-07-06 20:01:23 +03:00
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
|
|
export const useBrainApi = () => {
|
|
|
|
const { axiosInstance } = useAxios();
|
|
|
|
|
|
|
|
return {
|
|
|
|
getBrainDocuments: async (brainId: string) =>
|
|
|
|
getBrainDocuments(brainId, axiosInstance),
|
2023-07-07 13:56:08 +03:00
|
|
|
createBrain: async (name: string) => createBrain(name, axiosInstance),
|
|
|
|
deleteBrain: async (id: string) => deleteBrain(id, axiosInstance),
|
|
|
|
getDefaultBrain: async () => getDefaultBrain(axiosInstance),
|
|
|
|
getBrains: async () => getBrains(axiosInstance),
|
|
|
|
getBrain: async (id: string) => getBrain(id, axiosInstance),
|
2023-07-06 20:01:23 +03:00
|
|
|
};
|
|
|
|
};
|