Fix for production

This commit is contained in:
mahmood
2026-09-10 22:37:29 +03:30
parent efb0051ab9
commit ec899defb9
95 changed files with 219589 additions and 110 deletions
+4 -2
View File
@@ -12,8 +12,10 @@ declare module 'axios' {
}
}
const apiBaseURL = import.meta.env.VITE_API_BASE_URL || '/api';
export const apiClient = axios.create({
baseURL: '/api',
baseURL: apiBaseURL,
headers: {
'Content-Type': 'application/json',
},
@@ -96,7 +98,7 @@ apiClient.interceptors.response.use(
}
try {
const { data } = await axios.post('/api/admin/auth/refresh', { refreshToken });
const { data } = await axios.post(`${apiBaseURL}/admin/auth/refresh`, { refreshToken });
const newToken = data.data?.accessToken || data.accessToken;
localStorage.setItem('admin_access_token', newToken);
apiClient.defaults.headers.common.Authorization = `Bearer ${newToken}`;
+9
View File
@@ -0,0 +1,9 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_BASE_URL?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}