Client/admin page #43

Merged
KevinMidboe merged 9 commits from client/admin_page into master 2017-10-20 22:16:02 +00:00
Showing only changes of commit 2fd515d997 - Show all commits

View File

@@ -15,7 +15,7 @@ import { getCookie } from './Cookie.jsx';
return response;
}
function parseJSON(response) { response.json(); }
function parseJSON(response) { return response.json(); }
@@ -41,12 +41,12 @@ import { getCookie } from './Cookie.jsx';
// export default http;
export function fetchJSON(url, method, data) {
return fetch(url, {
method: method,
headers: new Headers({
'Content-Type': 'application/json',
'authorization': getCookie('token'),
}),
body: JSON.stringify(data)
}).then(checkStatus).then(parseJSON);
}
return fetch(url, {
method: method,
headers: new Headers({
'Content-Type': 'application/json',
'authorization': getCookie('token'),
}),
body: JSON.stringify(data)
}).then(checkStatus).then(parseJSON);
}