mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
12 lines
565 B
TypeScript
12 lines
565 B
TypeScript
import { json } from "@sveltejs/kit";
|
|
import { authorize } from "$lib/server/modules/auth";
|
|
import { clientListResponse, type ClientListResponse } from "$lib/server/schemas";
|
|
import { getUserClientList } from "$lib/server/services/client";
|
|
import type { RequestHandler } from "./$types";
|
|
|
|
export const GET: RequestHandler = async ({ locals }) => {
|
|
const { userId } = await authorize(locals, "anyClient");
|
|
const { userClients } = await getUserClientList(userId);
|
|
return json(clientListResponse.parse({ clients: userClients } satisfies ClientListResponse));
|
|
};
|