diff options
| author | Adam Soltys <[email protected]> | 2022-11-09 11:18:38 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-09 11:18:38 -0800 |
| commit | c901b229121ee74b4a1a8794ca7578d9cfea0055 (patch) | |
| tree | bb8192035e7076ffae126a6596088d96402768a4 /src/routes/(app)/support/+page.server.js | |
| parent | 305f26ccefffe52b3fb65995e8caf437f1a92057 (diff) | |
| download | coinos-ui-c901b229121ee74b4a1a8794ca7578d9cfea0055.tar.gz coinos-ui-c901b229121ee74b4a1a8794ca7578d9cfea0055.zip | |
fix support form
Diffstat (limited to 'src/routes/(app)/support/+page.server.js')
| -rw-r--r-- | src/routes/(app)/support/+page.server.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/routes/(app)/support/+page.server.js b/src/routes/(app)/support/+page.server.js new file mode 100644 index 00000000..78c640e3 --- /dev/null +++ b/src/routes/(app)/support/+page.server.js @@ -0,0 +1,16 @@ +import { post } from "$lib/utils"; +import { invalid } from '@sveltejs/kit'; + +export const actions = { + default: async ({ cookies, request }) => { + let form = Object.fromEntries(await request.formData()); + + try { + await post('/email', form); + } catch (e) { + return invalid(400, { error: e.message }); + } + + return { success: true }; + } +}; |
