From 7c1dec940159b151af6cd76ac9f97c9aec4a79d3 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Tue, 28 Jan 2025 16:39:13 +1100 Subject: [PATCH] fix: store style & library game page --- pages/library/game/[id]/index.vue | 12 ++++++------ pages/store/index.vue | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pages/library/game/[id]/index.vue b/pages/library/game/[id]/index.vue index e0cf103..794bff6 100644 --- a/pages/library/game/[id]/index.vue +++ b/pages/library/game/[id]/index.vue @@ -79,19 +79,19 @@ import { import { type Game, type GameVersion, type Collection } from "@prisma/client"; const route = useRoute(); -const headers = useRequestHeaders(["cookie"]); -const { data: gamesData } = await useFetch< - (Game & { versions: GameVersion[] })[] ->("/api/v1/store/recent", { headers }); const collections = await useCollections(); -const game = collections.value +const library = await useLibrary(); +const game = [...collections.value, library.value] .map((e) => e.entries.map((e) => e.game)) .flat() .find((e) => e.id == route.params.id); if (game === undefined) - throw createError({ statusCode: 404, statusMessage: "Game not found" }); + throw createError({ + statusCode: 404, + statusMessage: JSON.stringify(collections.value), + });