mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 16:51:15 +10:00
feat: partial user platform support + statusMessage -> message
This commit is contained in:
@ -28,7 +28,7 @@ export default defineEventHandler(async (h3) => {
|
||||
const query = getQuery(h3);
|
||||
const options = StoreRead(query);
|
||||
if (options instanceof ArkErrors)
|
||||
throw createError({ statusCode: 400, statusMessage: options.summary });
|
||||
throw createError({ statusCode: 400, message: options.summary });
|
||||
|
||||
/**
|
||||
* Generic filters
|
||||
|
||||
16
server/api/v1/store/platforms.get.ts
Normal file
16
server/api/v1/store/platforms.get.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const userId = await aclManager.getUserIdACL(h3, ["store:read"]);
|
||||
if (!userId) throw createError({ statusCode: 403 });
|
||||
|
||||
const platforms = await prisma.userPlatform.findMany({
|
||||
orderBy: { platformName: "asc" },
|
||||
select: {
|
||||
id: true,
|
||||
platformName: true,
|
||||
},
|
||||
});
|
||||
return platforms;
|
||||
});
|
||||
Reference in New Issue
Block a user