/api/client/list Endpoint 추가

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

No files matched your search

+10
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 });
};