aboutsummaryrefslogtreecommitdiff
path: root/fe/src/utils.ts
diff options
context:
space:
mode:
authorzberwaldt <17715430+zberwaldt@users.noreply.github.com>2024-03-15 22:03:11 -0400
committerGitHub <noreply@github.com>2024-03-15 22:03:11 -0400
commit6f8cfbd6cc3d5adbda38e74013c68e3d4745766d (patch)
treeb3f045cd06d6622e23441b442e8f3861050ed444 /fe/src/utils.ts
parentfac21fa0a72d4a7f1a01ccd44e3acf9c90fd95bd (diff)
parentfd1332a3df191577e91c6d846a8b5db1747099fd (diff)
Merge pull request #1 from zberwaldt/staging
Staging to Prod
Diffstat (limited to 'fe/src/utils.ts')
-rw-r--r--fe/src/utils.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/fe/src/utils.ts b/fe/src/utils.ts
new file mode 100644
index 0000000..9fddf41
--- /dev/null
+++ b/fe/src/utils.ts
@@ -0,0 +1,14 @@
1export function processFormInput(form: HTMLFormElement) {
2 const formData: FormData = new FormData(form);
3 const data: Record<string, any> = {};
4 for (let field of formData) {
5 const [key, value] = field;
6 data[key] = value;
7 }
8 return data;
9}
10
11export function apiURL (path: string): string {
12 const baseUrl = import.meta.env?.VITE_API_BASE_URL ?? "http://localhost:8080/api/v1";
13 return `${baseUrl}${path}`
14}