Files
drop/server/api/v1/admin/library/sources/index.get.ts
DecDuck 2056871dc9 Add UI for multi-library management #59 (#63)
* feat: add ui for library source management

* fix: lint
2025-06-01 18:33:42 +10:00

17 lines
526 B
TypeScript

import type { Library } from "~/prisma/client";
import aclManager from "~/server/internal/acls";
import libraryManager from "~/server/internal/library";
export type WorkingLibrarySource = Library & { working: boolean };
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, ["library:sources:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const sources = await libraryManager.fetchLibraries();
// Fetch other library data here
return sources;
});