mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 08:41:15 +10:00
feat: very basic screenshot api
This commit is contained in:
11
server/api/v1/screenshots/index.get.ts
Normal file
11
server/api/v1/screenshots/index.get.ts
Normal file
@ -0,0 +1,11 @@
|
||||
// get all user screenshots
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import screenshotManager from "~/server/internal/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;
|
||||
});
|
||||
Reference in New Issue
Block a user