Perform a bit of code cleanup

This commit is contained in:
DaneEveritt 2022-05-22 17:23:48 -04:00
parent be88e4e893
commit 4d3362b24f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 6 additions and 82 deletions

View file

@ -11,18 +11,6 @@ const http: AxiosInstance = axios.create({
},
});
http.interceptors.request.use(req => {
const cookies = document.cookie.split(';').reduce((obj, val) => {
const [ key, value ] = val.trim().split('=').map(decodeURIComponent);
return { ...obj, [key]: value };
}, {} as Record<string, string>);
req.headers['X-XSRF-TOKEN'] = cookies['XSRF-TOKEN'] || 'nil';
return req;
});
http.interceptors.request.use(req => {
if (!req.url?.endsWith('/resources')) {
store.getActions().progress.startContinuous();