fix hot bugs.

This commit is contained in:
Ahmed Bouhuolia
2020-04-26 03:09:33 +02:00
parent d14ff872d4
commit e01ad95ac3
31 changed files with 251 additions and 350 deletions

View File

@@ -5,12 +5,15 @@ const http = axios.create();
http.interceptors.request.use((request) => {
const state = store.getState();
const token = state.authentication.token;
const { token, organization } = state.authentication;
const locale = 'en';
if (token) {
request.headers.common['x-access-token'] = token;
}
if (organization) {
request.headers.common['organization-id'] = organization;
}
if (locale) {
request.headers.common['Accept-Language'] = locale;
}