fix: remove duplicate component instance

This commit is contained in:
Sajad Mirjalili
2025-09-25 17:13:44 +03:30
parent fff86c5ff1
commit d5531b2508
11 changed files with 60 additions and 335 deletions

View File

@@ -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) => {