From f617dbb93e7042b2ed427d75c89f4444d6a44385 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 7 Nov 2020 01:03:52 +0100 Subject: [PATCH] Changed endpoints and db queries, chart now shows suggested mins and maxes --- charts.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/charts.html b/charts.html index 3b5e922..68c9479 100644 --- a/charts.html +++ b/charts.html @@ -17,8 +17,9 @@ async function getData() { let urlEndpoint = "data/"; - if (window.location.includes("since")) { - urlEndpoint += "since/" + window.location.slice(window.location.lastIndexOf("/") + 1); + const pathname = window.location.pathname; + if (pathname.includes("since")) { + urlEndpoint += "since/" + pathname.slice(pathname.lastIndexOf("/") + 1); } const data = await fetch(urlEndpoint); return transformData(await data.json());