feat: something with something

This commit is contained in:
moolcoov
2025-03-02 13:52:42 +03:00
parent 62e44aba4c
commit b220004ea5
25 changed files with 369 additions and 126 deletions
+2 -3
View File
@@ -14,17 +14,16 @@ export class ApiError extends Error {
}
}
export const authFetch = ofetch.create({
export const apiFetch = ofetch.create({
baseURL: BASE_URL,
async onResponseError({ response }) {
throw new ApiError(response);
},
});
export const apiFetch = ofetch.create({
export const userFetch = ofetch.create({
baseURL: BASE_URL,
async onRequest({ options }) {
console.log(import.meta.env.VITE_API_ENDPOINT);
options.headers.set("Authorization", "Bearer " + getToken());
},
async onResponseError({ response }) {