Files
drop/server/api/v1/screenshots/index.get.ts
2025-08-10 10:19:45 +10:00

15 lines
438 B
TypeScript

// get all user screenshots
import aclManager from "~/server/internal/acls";
import screenshotManager from "~/server/internal/screenshots";
/**
* Fetch all screenshots
*/
export default defineEventHandler(async (h3) => {
const userId = await aclManager.getUserIdACL(h3, ["screenshots:read"]);
if (!userId) throw createError({ statusCode: 403 });
const results = await screenshotManager.getUserAll(userId);
return results;
});