/api/mek/register/initial Endpoint 추가

This commit is contained in:
static
2024-12-30 00:37:53 +09:00
parent ee752494cd
commit 04780d2493
9 changed files with 145 additions and 35 deletions

View File

@@ -1,14 +1,10 @@
import { error, json } from "@sveltejs/kit";
import { authenticate } from "$lib/server/modules/auth";
import { authorize } 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 { userId, clientId } = await authorize(cookies, "activeClient");
const { meks } = await getClientMekList(userId, clientId);
return json({ meks });
};