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 = await processThreadOut(form); console.log(t); await api('post', `thread/${form.get('board')}`, JSON.stringify(t)); return new Response(t.id, { status: 200 }); }