This commit is contained in:
2025-03-20 14:26:57 +05:00
commit eb552cbdc8
55 changed files with 2212 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import ky from "ky";
import useAuthStore from "../stores/useAuthStore";
const api = ky.create({
prefixUrl: import.meta.env.VITE_API_URL,
retry: 0,
hooks: {
beforeRequest: [
(request) => {
const token = useAuthStore.getState().token;
if (token) {
request.headers.set("Authorization", `Bearer ${token}`);
}
},
],
},
});
export default api;