import { api } from '../../lib/api'; import { processThreadOut } from '../../lib/thread'; import Thread from '../../models/Thread'; export async function post({ request }) { const form = await request.formData(); let t: Thread = processThreadOut(form); let r = await api('post', `board/${form.get('board')}`, JSON.stringify(t)); return new Response(await r.text(), { status: r.status }); }