/api/mek/list, /api/mek/register Endpoint 구현

This commit is contained in:
static
2024-12-29 21:52:33 +09:00
parent 3664ad66ac
commit 97f6e1e32f
6 changed files with 186 additions and 24 deletions

View File

@@ -0,0 +1,14 @@
import { error, json } from "@sveltejs/kit";
import { authenticate } from "$lib/server/modules/auth";
import { getClientMekList } from "$lib/server/services/mek";
import type { RequestHandler } from "@sveltejs/kit";
export const GET: RequestHandler = async ({ cookies }) => {
const { userId, clientId } = authenticate(cookies);
if (!clientId) {
error(403, "Forbidden");
}
const { meks } = await getClientMekList(userId, clientId);
return json({ meks });
};