mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 16:51:15 +10:00
17 lines
526 B
TypeScript
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;
|
|
});
|