aboutsummaryrefslogtreecommitdiff
path: root/src/pages/create/comment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/create/comment.ts')
-rw-r--r--src/pages/create/comment.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pages/create/comment.ts b/src/pages/create/comment.ts
new file mode 100644
index 0000000..f8d4c82
--- /dev/null
+++ b/src/pages/create/comment.ts
@@ -0,0 +1,17 @@
+import { api } from '../../lib/api';
+import { processCommentOut } from '../../lib/thread';
+import Comment from '../../models/Thread';
+
+export async function post({ request }) {
+ const form = await request.formData();
+
+ let c: Comment = await processCommentOut(form);
+
+ console.log(c);
+
+ await api('post', `comment/${form.get('board')}/${form.get('tid')}`, JSON.stringify(c));
+
+ return new Response('close', {
+ status: 200
+ });
+}