diff --git a/fe/src/lib/Chart.svelte b/fe/src/lib/Chart.svelte
new file mode 100644
index 0000000..b19d932
--- /dev/null
+++ b/fe/src/lib/Chart.svelte
@@ -0,0 +1,63 @@
+
+
+
\ No newline at end of file
diff --git a/fe/src/lib/DataView.svelte b/fe/src/lib/DataView.svelte
index 0a6b81b..5e81a5a 100644
--- a/fe/src/lib/DataView.svelte
+++ b/fe/src/lib/DataView.svelte
@@ -1,10 +1,11 @@
+
+
diff --git a/fe/src/lib/errors.ts b/fe/src/lib/errors.ts
index d44bec5..81f7145 100644
--- a/fe/src/lib/errors.ts
+++ b/fe/src/lib/errors.ts
@@ -1,7 +1,5 @@
export class UnauthorizedError extends Error {
- constructor(message?: string, options?: ErrorOptions) {
- super(message, options);
+ constructor(message?: string) {
+ super(message);
}
}
-
-
diff --git a/fe/src/lib/utils.ts b/fe/src/lib/utils.ts
index 22d4e9a..e78556c 100644
--- a/fe/src/lib/utils.ts
+++ b/fe/src/lib/utils.ts
@@ -1,5 +1,5 @@
export function processFormInput(form: HTMLFormElement) {
- const formData = new FormData(form);
+ const formData: FormData = new FormData(form);
const data: Record
= {};
for (let field of formData) {
const [key, value] = field;
--
cgit v1.1
From c4e5776f9e174fe6bf91721649c0541a9fb310ae Mon Sep 17 00:00:00 2001
From: Zach Berwaldt
Date: Fri, 15 Mar 2024 21:41:12 -0400
Subject: add env samples, move files
---
fe/src/lib/errors.ts | 5 -----
fe/src/lib/utils.ts | 9 ---------
2 files changed, 14 deletions(-)
delete mode 100644 fe/src/lib/errors.ts
delete mode 100644 fe/src/lib/utils.ts
(limited to 'fe/src/lib')
diff --git a/fe/src/lib/errors.ts b/fe/src/lib/errors.ts
deleted file mode 100644
index 81f7145..0000000
--- a/fe/src/lib/errors.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export class UnauthorizedError extends Error {
- constructor(message?: string) {
- super(message);
- }
-}
diff --git a/fe/src/lib/utils.ts b/fe/src/lib/utils.ts
deleted file mode 100644
index e78556c..0000000
--- a/fe/src/lib/utils.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export function processFormInput(form: HTMLFormElement) {
- const formData: FormData = new FormData(form);
- const data: Record = {};
- for (let field of formData) {
- const [key, value] = field;
- data[key] = value;
- }
- return data;
-}
--
cgit v1.1
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 ++++---
fe/src/lib/LoginForm.svelte | 3 ++-
fe/src/lib/PreferencesForm.svelte | 15 ++++++++-------
fe/src/lib/forms/AddForm.svelte | 3 ++-
4 files changed, 16 insertions(+), 12 deletions(-)
(limited to 'fe/src/lib')
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}`
diff --git a/fe/src/lib/LoginForm.svelte b/fe/src/lib/LoginForm.svelte
index 8c3c288..cf5febf 100644
--- a/fe/src/lib/LoginForm.svelte
+++ b/fe/src/lib/LoginForm.svelte
@@ -1,6 +1,7 @@