mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 00:31:25 +10:00
feat(store): new endpoints, ui and beginnings of main store page
This commit is contained in:
20
server/api/v1/store/updated.get.ts
Normal file
20
server/api/v1/store/updated.get.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const userId = await h3.context.session.getUserId(h3);
|
||||
if (!userId) throw createError({ statusCode: 403 });
|
||||
|
||||
const versions = await prisma.gameVersion.findMany({
|
||||
select: {
|
||||
game: true,
|
||||
created: true,
|
||||
platform: true,
|
||||
},
|
||||
orderBy: {
|
||||
created: "desc",
|
||||
},
|
||||
take: 8,
|
||||
});
|
||||
|
||||
return { versions };
|
||||
});
|
||||
Reference in New Issue
Block a user