Add classroom dust levels to /charts page

This commit is contained in:
2021-07-02 03:50:14 +00:00
parent a7b1009d64
commit 8fa5131364
2 changed files with 51 additions and 1 deletions
+8 -1
View File
@@ -32,6 +32,7 @@ export const BasicTable = (props) => (
export const requester = (route, method, token, data) => {
let options = {headers: {}};
let url = '';
if (token) {
options.headers.Authorization = 'Token ' + token;
@@ -65,7 +66,13 @@ export const requester = (route, method, token, data) => {
return error;
}
return fetch(apiUrl + route, options)
if (route.startsWith('http')) {
url = route;
} else {
url = apiUrl + route;
}
return fetch(url, options)
.then(response => {
if (!response.ok) {
throw customError(response);