aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/generate/+server.ts
blob: 5a442982c2679b0bc3c88461aff8fd88935b8b17 (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 }) {
  try {
    let body = await request.json();
    return json(await post(`/user`, body, auth(cookies)));
  } catch (e: any) {
    console.log(e);
    error(500, e.message);
  }
}