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