aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/support/+page.server.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-09 11:18:38 -0800
committerAdam Soltys <[email protected]>2022-11-09 11:18:38 -0800
commit5a1f8f23c9ac6b8ab92f6d7c453a325c6b3d207a (patch)
treebb8192035e7076ffae126a6596088d96402768a4 /src/routes/(app)/support/+page.server.js
parenta440e188e36d0b5e5e6e520f9fb311a691f3c4e0 (diff)
downloadcoinos-ui-5a1f8f23c9ac6b8ab92f6d7c453a325c6b3d207a.tar.gz
coinos-ui-5a1f8f23c9ac6b8ab92f6d7c453a325c6b3d207a.zip
fix support form
Diffstat (limited to 'src/routes/(app)/support/+page.server.js')
-rw-r--r--src/routes/(app)/support/+page.server.js16
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 };
+ }
+};