aboutsummaryrefslogtreecommitdiff
path: root/fe/src/lib/DataView.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'fe/src/lib/DataView.svelte')
-rw-r--r--fe/src/lib/DataView.svelte7
1 files changed, 4 insertions, 3 deletions
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 @@
9 import Card from "./Card.svelte"; 9 import Card from "./Card.svelte";
10 import Column from "./Column.svelte"; 10 import Column from "./Column.svelte";
11 import AddForm from "./forms/AddForm.svelte"; 11 import AddForm from "./forms/AddForm.svelte";
12 import { apiURL } from "../utils";
12 13
13 let json: Promise<any>; 14 let json: Promise<any>;
14 15
@@ -24,7 +25,7 @@
24 let userTotalsData: number[]; 25 let userTotalsData: number[];
25 26
26 async function fetchData() { 27 async function fetchData() {
27 const res = await fetch("http://localhost:8080/api/v1/stats/", { 28 const res = await fetch(apiURL("stats"), {
28 method: "GET", 29 method: "GET",
29 headers: { 30 headers: {
30 Authorization: `Bearer ${$token}` 31 Authorization: `Bearer ${$token}`
@@ -38,7 +39,7 @@
38 } 39 }
39 40
40 async function fetchDailyUserStatistics() { 41 async function fetchDailyUserStatistics() {
41 const res = await fetch("http://localhost:8080/api/v1/stats/daily/", { 42 const res = await fetch(apiURL("stats/daily"), {
42 method: "GET", 43 method: "GET",
43 headers: { 44 headers: {
44 Authorization: `Bearer ${$token}` 45 Authorization: `Bearer ${$token}`
@@ -57,7 +58,7 @@
57 } 58 }
58 59
59 async function fetchWeeklyTotals() { 60 async function fetchWeeklyTotals() {
60 const res = await fetch("http://localhost:8080/api/v1/stats/weekly/", { 61 const res = await fetch(apiURL("stats/weekly"), {
61 method: "GET", 62 method: "GET",
62 headers: { 63 headers: {
63 Authorization: `Bearer ${$token}` 64 Authorization: `Bearer ${$token}`