A
post: (url, body) => {
return fetch(`${API_ROOT}${url}`, {
method: 'POST',
headers: (generalStore.token !== null ? {Authorization: `Bearer ${generalStore.token}`} : {}),
body: body
}).then(response => response.json())
.then(handleErrors)
},
get: (url) => {
return fetch(`${API_ROOT}${url}`, {
method: 'GET',
headers: (generalStore.token !== null ? {Authorization: `Bearer ${generalStore.token}`} : {})
}).then(response => response.json())
.then(handleErrors)
}
}
сейчас смотрю что вроде через response.url.indexOf() можно перехватить url и от него плясать