mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 17:21:13 +10:00
feat: image provider + importer partial backend
This commit is contained in:
11
server/api/v1/admin/game/image/import/index.get.ts
Normal file
11
server/api/v1/admin/game/image/import/index.get.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import imageHandler from "~/server/internal/metadata/image";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:image:import"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const images = await imageHandler.searchImages("space engineers");
|
||||
|
||||
return images;
|
||||
});
|
||||
Reference in New Issue
Block a user