Skip to content

Commit

Permalink
ar(fix) DPCP-121: Locale Parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Aug 30, 2024
1 parent 3296cf8 commit 3618d6d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/model/decorators/hypnos-public-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import type { ICard } from '@dreampipcom/oneiros';

/* private */
const decorateListing = (listing: Record<string, any>, uMeta: any, locale?: string): ICard => {
const coerceString = (localeString: any) => {
return listing?.description[locale?.split('-')[1]] || listing?.description[locale?.split('-')[0]];
};
const decd: ICard = {
id: `${listing.id}`,
className: '',
title: `${listing?.title[locale || 'en']}`,
description: `${listing?.description[locale || 'en']}`,
title: `${coerceString(listing?.title)}`,
description: `${coerceString(listing?.description)}`,
where: `${listing?.location?.name}`,
latlng: `${listing?.location?.geo}`,
when: `${listing?.scheduledFor}`,
Expand Down

0 comments on commit 3618d6d

Please sign in to comment.