refactor: refactor foundation
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import createClient from "openapi-fetch";
|
||||
import createQueryClient from "openapi-react-query";
|
||||
|
||||
import { apiBaseUrl } from "./config";
|
||||
import type { paths } from "./generated/schema";
|
||||
|
||||
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL ?? "http://localhost:3000";
|
||||
|
||||
type AuthHandlers = {
|
||||
accessToken: () => string | null;
|
||||
refresh: () => Promise<boolean>;
|
||||
@@ -56,3 +58,5 @@ export const apiClient = createClient<paths>({
|
||||
credentials: "include",
|
||||
fetch: authenticatedFetch,
|
||||
});
|
||||
|
||||
export const apiQueryClient = createQueryClient(apiClient);
|
||||
|
||||
Reference in New Issue
Block a user