Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
15
research/chatwoot/app/javascript/widget/helpers/axios.js
Executable file
15
research/chatwoot/app/javascript/widget/helpers/axios.js
Executable file
@@ -0,0 +1,15 @@
|
||||
import axios from 'axios';
|
||||
import { APP_BASE_URL } from 'widget/helpers/constants';
|
||||
|
||||
export const API = axios.create({
|
||||
baseURL: APP_BASE_URL,
|
||||
withCredentials: false,
|
||||
});
|
||||
|
||||
export const setHeader = (value, key = 'X-Auth-Token') => {
|
||||
API.defaults.headers.common[key] = value;
|
||||
};
|
||||
|
||||
export const removeHeader = key => {
|
||||
delete API.defaults.headers.common[key];
|
||||
};
|
||||
Reference in New Issue
Block a user