diff options
author | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-15 21:41:12 -0400 |
---|---|---|
committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-15 21:41:12 -0400 |
commit | c4e5776f9e174fe6bf91721649c0541a9fb310ae (patch) | |
tree | 48ffe6ad9a265052dc0580ac28c9e2e3656c8ff6 /fe/src/utils.ts | |
parent | 9cae9c1d2a0b4f7fa72f3075541b9ffafe1a7275 (diff) |
add env samples, move files
Diffstat (limited to 'fe/src/utils.ts')
-rw-r--r-- | fe/src/utils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fe/src/utils.ts b/fe/src/utils.ts new file mode 100644 index 0000000..e78556c --- /dev/null +++ b/fe/src/utils.ts | |||
@@ -0,0 +1,9 @@ | |||
1 | export 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 | } | ||