refactor apiv1 to api

This commit is contained in:
IluaAir
2025-10-15 22:39:26 +03:00
parent ffe9a27921
commit 19321e3ea2
5 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
import axios from 'axios';
import { API_BASE_URL, API_V1_PREFIX } from './ApiSources';
const client = axios.create({
baseURL: `${API_BASE_URL}${API_V1_PREFIX}`,
timeout: 10000,
headers: {
'Content-Type': 'application/json',
},
withCredentials: true,
});
client.interceptors.request.use(
(config) => {
const token = localStorage.getItem('access_token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
);
export default client;