From fd1332a3df191577e91c6d846a8b5db1747099fd Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Fri, 15 Mar 2024 22:00:10 -0400 Subject: cleanup --- fe/src/lib/DataView.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fe/src/lib/DataView.svelte') diff --git a/fe/src/lib/DataView.svelte b/fe/src/lib/DataView.svelte index 5e81a5a..ffc2fe8 100644 --- a/fe/src/lib/DataView.svelte +++ b/fe/src/lib/DataView.svelte @@ -9,6 +9,7 @@ import Card from "./Card.svelte"; import Column from "./Column.svelte"; import AddForm from "./forms/AddForm.svelte"; + import { apiURL } from "../utils"; let json: Promise; @@ -24,7 +25,7 @@ let userTotalsData: number[]; async function fetchData() { - const res = await fetch("http://localhost:8080/api/v1/stats/", { + const res = await fetch(apiURL("stats"), { method: "GET", headers: { Authorization: `Bearer ${$token}` @@ -38,7 +39,7 @@ } async function fetchDailyUserStatistics() { - const res = await fetch("http://localhost:8080/api/v1/stats/daily/", { + const res = await fetch(apiURL("stats/daily"), { method: "GET", headers: { Authorization: `Bearer ${$token}` @@ -57,7 +58,7 @@ } async function fetchWeeklyTotals() { - const res = await fetch("http://localhost:8080/api/v1/stats/weekly/", { + const res = await fetch(apiURL("stats/weekly"), { method: "GET", headers: { Authorization: `Bearer ${$token}` -- cgit v1.1