Skip to content

Commit

Permalink
[Transition] Fix issue with loading individual listing
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Sep 13, 2024
1 parent 54a1bdb commit bf3f459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/transition/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ async function getListing({ listingSlug }): Promise<any> {
const { body: data } = await response.json()

const cleanedData = data.map((item) => {
const categoryLabel = item.hubs.replace(/&amp;/g, '&')
const categoryLabel = item.countries
.replace(/&amp;/g, '&')
.replace(' | United Kingdom', '')
.replace('United Kingdom | ', '')

const itemTags = []
item.tags.forEach((tagLabel) => {
const tagId = itemTags.length + 1
itemTags.push({
id: tagId,
label: tagLabel,
})
})
Expand Down
1 change: 0 additions & 1 deletion app/transition/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit bf3f459

Please sign in to comment.