Clean up main-axios.ts
This commit is contained in:
@@ -175,7 +175,6 @@ function createApiInstance(baseURL: string): AxiosInstance {
|
|||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add JWT token to all requests
|
|
||||||
instance.interceptors.request.use((config) => {
|
instance.interceptors.request.use((config) => {
|
||||||
const token = getCookie('jwt');
|
const token = getCookie('jwt');
|
||||||
if (token) {
|
if (token) {
|
||||||
@@ -184,7 +183,6 @@ function createApiInstance(baseURL: string): AxiosInstance {
|
|||||||
return config;
|
return config;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Global error handling
|
|
||||||
instance.interceptors.response.use(
|
instance.interceptors.response.use(
|
||||||
(response) => response,
|
(response) => response,
|
||||||
(error: AxiosError) => {
|
(error: AxiosError) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user