mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
/api/client/list Endpoint 추가
This commit is contained in:
10
src/routes/api/client/list/+server.ts
Normal file
10
src/routes/api/client/list/+server.ts
Normal 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 });
|
||||
};
|
||||
Reference in New Issue
Block a user