Skip to content

Commit

Permalink
fix: location shown as place name instead of
Browse files Browse the repository at this point in the history
street address
  • Loading branch information
syam babu committed Feb 8, 2024
1 parent 23ebc10 commit dd696c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/results/Results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Results = () => {
slug={item?.slug}
startDate={item?.startDate}
endDate={item?.endDate}
place={item?.streetAddress}
place={item?.place}
image={item?.image}
/>
))}
Expand Down
5 changes: 4 additions & 1 deletion src/utils/transformData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd696c6

Please sign in to comment.