Hitting the delete route and deleting the token

This commit is contained in:
Belen Curcio
2018-08-16 12:20:56 -03:00
parent e704c6d968
commit a48bcc3076
3 changed files with 17 additions and 15 deletions
+7 -6
View File
@@ -19,12 +19,13 @@ const buildOptions = (inputOptions: RequestInit = {}) => {
const handleResp = (res: Response) => {
if (res.status > 399) {
return res.json().then((err: any) => {
// TODO: sync error handling with server.
const message = err.message || err.error || res.status;
const error = new Error(message);
throw error;
});
return res.text();
// TODO (bc): sync error handling with server.
// return res.json().then((err: any) => {
// const message = err.message || err.error || res.status;
// const error = new Error(message);
// throw error;
// });
} else if (res.status === 204) {
return res.text();
} else {