From dd696c6ced90d8a0ff8b5cb5e2b1856628058d4e Mon Sep 17 00:00:00 2001 From: syam babu Date: Thu, 8 Feb 2024 19:47:03 +0530 Subject: [PATCH] fix: location shown as place name instead of street address --- src/components/results/Results.jsx | 2 +- src/utils/transformData.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/results/Results.jsx b/src/components/results/Results.jsx index 2860a66..0fe0d03 100644 --- a/src/components/results/Results.jsx +++ b/src/components/results/Results.jsx @@ -18,7 +18,7 @@ const Results = () => { slug={item?.slug} startDate={item?.startDate} endDate={item?.endDate} - place={item?.streetAddress} + place={item?.place} image={item?.image} /> ))} diff --git a/src/utils/transformData.js b/src/utils/transformData.js index c5ea06e..9b1aa0c 100644 --- a/src/utils/transformData.js +++ b/src/utils/transformData.js @@ -3,7 +3,10 @@ export const transformData = ({ data, locale }) => { let place = eventData.location || {}; // If place is an array then extract first object of type 'Place' if (Array.isArray(place)) { - place = eventData.location.filter((place) => place.type === 'Place')[0] || {}; + place = + eventData.location.filter( + (place) => place.type === 'Place' || place.type === 'VirtualLocation', + )[0] || {}; } // Fallback to English and then French if the locale-specific name is not available