aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/events/+server.ts
blob: f3010834f57456f687919c9db0db669ba4045de3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { auth, post } from "$lib/utils";
import { error, json } 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);
	}
}