quivr/frontend/lib/api/auth/auth.ts
Mamadou DICKO 0ce9c8ffcd
Frontend/test/config/2 (#542)
* test(useApiKeyConfig): add unit tests

* test(BackendConfig): add unit tests
2023-07-06 19:01:12 +02:00

10 lines
245 B
TypeScript

import { AxiosInstance } from "axios";
export const createApiKey = async (
axiosInstance: AxiosInstance
): Promise<string> => {
const response = await axiosInstance.post<{ api_key: string }>("/api-key");
return response.data.api_key;
};