/api/client/list Endpoint 추가

This commit is contained in:
static
2024-12-29 22:03:39 +09:00
parent 97f6e1e32f
commit 4a10ba0fbf
4 changed files with 28 additions and 10 deletions

View File

@@ -0,0 +1,10 @@
import { json } from "@sveltejs/kit";
import { authenticate } from "$lib/server/modules/auth";
import { getUserClientList } from "$lib/server/services/client";
import type { RequestHandler } from "@sveltejs/kit";
export const GET: RequestHandler = async ({ cookies }) => {
const { userId } = authenticate(cookies);
const { userClients } = await getUserClientList(userId);
return json({ clients: userClients });
};