aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/events/+server.ts
blob: 42b9f3ddeb44baddee317ef1ee2fd765567a0ced (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { auth, post } from "$lib/utils";
import { json, error } from "@sveltejs/kit";

export async function POST({ cookies, request }) {
	const body = await request.json();
	try {
		const result = await post("/event", body, auth(cookies));
		return json(result);
	} catch (e: any) {
		error(500, e.message);
	}
}