aboutsummaryrefslogtreecommitdiff
path: root/src/pages/create/comment.ts
blob: f8d4c8264f5ab12578f753db36982ced7fd72f51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
  });
}