fix: remove duplicate component instance
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import i18n from '@/config/i18n';
|
||||
import { ACCESS_TOKEN_KEY } from '@/providers/AuthProvider';
|
||||
import axios from 'axios';
|
||||
|
||||
@@ -24,6 +25,14 @@ apiClient.interceptors.request.use(
|
||||
// Add the authorization token to the headers
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
const currentLang = i18n.language;
|
||||
if (currentLang) {
|
||||
// If language is 'fa', send 'fa-IR', otherwise send the language code as is
|
||||
config.headers['Accept-Language'] =
|
||||
currentLang === 'fa' ? 'fa-IR' : 'en-US';
|
||||
}
|
||||
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
|
||||
Reference in New Issue
Block a user