fix(Axios & Layout): add Shop-ID header to Axios instance and navigate to home on shop ID set

This commit is contained in:
josheqani
2025-05-13 08:31:23 +03:30
parent bd4e3feea0
commit 08bde1ff4b
3 changed files with 9 additions and 2 deletions

View File

@@ -10,6 +10,11 @@ const useAxios = () => {
const instance = axios.create({
baseURL: "https://api.persain-game.com/api/v1",
maxBodyLength: Infinity,
...(sessionStorage.getItem("shop_id") && {
headers: {
"Shop-ID": sessionStorage.getItem("shop_id"),
},
}),
});
instance.interceptors.request.use(