mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-12 07:42:40 +10:00
feat: ratings ui, import giantbomb ratings
This commit is contained in:
@ -22,5 +22,17 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!game)
|
||||
throw createError({ statusCode: 404, statusMessage: "Game not found" });
|
||||
|
||||
return game;
|
||||
const rating = await prisma.gameRating.aggregate({
|
||||
where: {
|
||||
gameId: game.id,
|
||||
},
|
||||
_avg: {
|
||||
mReviewRating: true,
|
||||
},
|
||||
_sum: {
|
||||
mReviewCount: true,
|
||||
},
|
||||
});
|
||||
|
||||
return { game, rating };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user