mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 08:41:15 +10:00
Store overhaul (#142)
* feat: small library tweaks + company page * feat: new store view * fix: ci merge error * feat: add genres to store page * feat: sorting * feat: lock game/version imports while their tasks are running * feat: feature games * feat: tag based filtering * fix: make tags alphabetical * refactor: move a bunch of i18n to common * feat: add localizations for everything * fix: title description on panel * fix: feature carousel text * fix: i18n footer strings * feat: add tag page * fix: develop merge * feat: offline games support (don't error out if provider throws) * feat: tag management * feat: show library next to game import + small fixes * feat: most of the company and tag managers * feat: company text field editing * fix: small fixes + tsgo experiemental * feat: upload icon and banner * feat: store infinite scrolling and bulk import mode * fix: lint * fix: add drop-base to prettier ignore
This commit is contained in:
37
server/api/v1/store/featured.get.ts
Normal file
37
server/api/v1/store/featured.get.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const userId = await aclManager.getUserACL(h3, ["store:read"]);
|
||||
if (!userId) throw createError({ statusCode: 403 });
|
||||
|
||||
const games = await prisma.game.findMany({
|
||||
where: {
|
||||
featured: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
mName: true,
|
||||
mShortDescription: true,
|
||||
mCoverObjectId: true,
|
||||
mBannerObjectId: true,
|
||||
developers: {
|
||||
select: {
|
||||
id: true,
|
||||
mName: true,
|
||||
},
|
||||
},
|
||||
publishers: {
|
||||
select: {
|
||||
id: true,
|
||||
mName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: {
|
||||
created: "desc",
|
||||
},
|
||||
});
|
||||
|
||||
return games;
|
||||
});
|
||||
Reference in New Issue
Block a user