aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice/+server.ts
blob: b18eae154e74962d6b851aa00e8961eba63e5329 (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);
  }
};