aboutsummaryrefslogtreecommitdiff
path: root/fe/src/lib/forms/AddForm.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'fe/src/lib/forms/AddForm.svelte')
-rw-r--r--fe/src/lib/forms/AddForm.svelte3
1 files changed, 2 insertions, 1 deletions
diff --git a/fe/src/lib/forms/AddForm.svelte b/fe/src/lib/forms/AddForm.svelte
index 4520b1b..f85cce6 100644
--- a/fe/src/lib/forms/AddForm.svelte
+++ b/fe/src/lib/forms/AddForm.svelte
@@ -2,6 +2,7 @@
2 import { createEventDispatcher } from "svelte"; 2 import { createEventDispatcher } from "svelte";
3 import { token, user } from "../../stores/auth"; 3 import { token, user } from "../../stores/auth";
4 import type { Statistic } from "../../types"; 4 import type { Statistic } from "../../types";
5 import { apiURL } from "../../utils";
5 6
6 export let open: boolean; 7 export let open: boolean;
7 8
@@ -37,7 +38,7 @@
37 async function handleSubmitStat() 38 async function handleSubmitStat()
38 { 39 {
39 const { date, quantity } = statistic; 40 const { date, quantity } = statistic;
40 await fetch("http://localhost:8080/api/v1/stats/", { 41 await fetch(apiURL("stats"), {
41 method: "POST", 42 method: "POST",
42 headers: { 43 headers: {
43 Authorization: `Bearer ${$token}` 44 Authorization: `Bearer ${$token}`