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 3618d6d commit c123510
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/model/decorators/hypnos-public-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +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 coerceStringLocale = (localeString: any) => {
return localeString[locale?.split('-')[1]] || localeString[locale?.split('-')[0]];
};
const decd: ICard = {
id: `${listing.id}`,
className: '',
title: `${coerceString(listing?.title)}`,
description: `${coerceString(listing?.description)}`,
title: `${coerceStringLocale(listing?.title)}`,
description: `${coerceStringLocale(listing?.description)}`,
where: `${listing?.location?.name}`,
latlng: `${listing?.location?.geo}`,
when: `${listing?.scheduledFor}`,
Expand Down

0 comments on commit c123510

Please sign in to comment.