Changed endpoints and db queries, chart now shows suggested mins and maxes

This commit is contained in:
Daniel Ledda
2020-11-07 01:03:52 +01:00
parent 5a522245c1
commit f617dbb93e

View File

@@ -17,8 +17,9 @@
async function getData() { async function getData() {
let urlEndpoint = "data/"; let urlEndpoint = "data/";
if (window.location.includes("since")) { const pathname = window.location.pathname;
urlEndpoint += "since/" + window.location.slice(window.location.lastIndexOf("/") + 1); if (pathname.includes("since")) {
urlEndpoint += "since/" + pathname.slice(pathname.lastIndexOf("/") + 1);
} }
const data = await fetch(urlEndpoint); const data = await fetch(urlEndpoint);
return transformData(await data.json()); return transformData(await data.json());