mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 23:18:48 +00:00
12 lines
525 B
TypeScript
12 lines
525 B
TypeScript
import { json } from "@sveltejs/kit";
|
|
import { authorize } from "$lib/server/modules/auth";
|
|
import { fileListResponse, type FileListResponse } from "$lib/server/schemas";
|
|
import { getFileList } from "$lib/server/services/file";
|
|
import type { RequestHandler } from "./$types";
|
|
|
|
export const GET: RequestHandler = async ({ locals }) => {
|
|
const { userId } = await authorize(locals, "activeClient");
|
|
const { files } = await getFileList(userId);
|
|
return json(fileListResponse.parse({ files } satisfies FileListResponse));
|
|
};
|