aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice/+server.ts
blob: f494c1532a42499d34613193720b9b70cd7f050c (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 const POST = async ({ cookies, request }) => {
	try {
		const body = await request.json();
		return json(await post("/invoice", body, auth(cookies)));
	} catch (e) {
		const { message } = e as Error;
		error(500, message);
	}
};