From bf3f4595d574c06b196a04fb89a381a91987e357 Mon Sep 17 00:00:00 2001 From: Diner Date: Fri, 13 Sep 2024 19:36:22 +0100 Subject: [PATCH] [Transition] Fix issue with loading individual listing --- app/transition/[slug]/page.tsx | 7 ++++++- app/transition/page.tsx | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/transition/[slug]/page.tsx b/app/transition/[slug]/page.tsx index b3063135..208309c1 100644 --- a/app/transition/[slug]/page.tsx +++ b/app/transition/[slug]/page.tsx @@ -64,11 +64,16 @@ async function getListing({ listingSlug }): Promise { const { body: data } = await response.json() const cleanedData = data.map((item) => { - const categoryLabel = item.hubs.replace(/&/g, '&') + const categoryLabel = item.countries + .replace(/&/g, '&') + .replace(' | United Kingdom', '') + .replace('United Kingdom | ', '') const itemTags = [] item.tags.forEach((tagLabel) => { + const tagId = itemTags.length + 1 itemTags.push({ + id: tagId, label: tagLabel, }) }) diff --git a/app/transition/page.tsx b/app/transition/page.tsx index c50a4b06..70ecf167 100644 --- a/app/transition/page.tsx +++ b/app/transition/page.tsx @@ -69,7 +69,6 @@ async function getData() { .replace(' | United Kingdom', '') .replace('United Kingdom | ', '') if (!categories.some((c) => c.label === categoryLabel)) { - console.log(categoryLabel) categories.push({ label: categoryLabel, color: COLOR_MAPPING[categoryLabel].substring(1),