From 3fbe514f659b56709ac35a1527299fe2e8a48e25 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Fri, 30 May 2025 22:07:50 +1000 Subject: [PATCH] feat: ratings ui, import giantbomb ratings --- pages/library/game/[id]/index.vue | 3 +-- pages/store/[id]/index.vue | 14 ++++++------- prisma/models/content.prisma | 2 +- server/api/v1/games/[id]/index.get.ts | 14 ++++++++++++- server/internal/metadata/giantbomb.ts | 29 ++++++++++++++++++++++++++- server/internal/metadata/igdb.ts | 25 +++++++++++++---------- yarn.lock | 2 +- 7 files changed, 64 insertions(+), 25 deletions(-) diff --git a/pages/library/game/[id]/index.vue b/pages/library/game/[id]/index.vue index 7b87fc1..4daac62 100644 --- a/pages/library/game/[id]/index.vue +++ b/pages/library/game/[id]/index.vue @@ -120,12 +120,11 @@ import { ArrowUpRightIcon, } from "@heroicons/vue/20/solid"; import { micromark } from "micromark"; -import type { Game } from "~/prisma/client"; const route = useRoute(); const id = route.params.id.toString(); -const rawGame = await $dropFetch(`/api/v1/games/${id}`); +const { game: rawGame } = await $dropFetch(`/api/v1/games/${id}`); const game = computed(() => { if (!rawGame) { throw createError({ statusCode: 404, message: "Game not found" }); diff --git a/pages/store/[id]/index.vue b/pages/store/[id]/index.vue index 48f2ec7..844082d 100644 --- a/pages/store/[id]/index.vue +++ b/pages/store/[id]/index.vue @@ -103,7 +103,9 @@ 'w-4 h-4', ]" /> - ({{ 0 }} reviews) + ({{ rating._sum.mReviewCount ?? 0 }} reviews) @@ -174,10 +176,8 @@