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 }); }