fixed the details
All checks were successful
Build frontend / build (push) Successful in 43s

This commit is contained in:
mouazkh
2026-05-26 00:20:20 +03:00
parent 085c60ec33
commit 9f6492cf41
4 changed files with 115 additions and 8 deletions

View File

@ -19,7 +19,13 @@ async function fetchPropertyForMeta(id) {
function mapProperty(item) {
const info = item.propertyInformation || item.PropertyInformation || {};
let details = {};
try { details = JSON.parse(info.detailsJSON || info.DetailsJSON || '{}'); } catch {}
if (typeof info.detailsJSON === 'object' && info.detailsJSON) {
details = info.detailsJSON;
} else if (typeof info.DetailsJSON === 'object' && info.DetailsJSON) {
details = info.DetailsJSON;
} else {
try { details = JSON.parse(info.detailsJSON || info.DetailsJSON || '{}'); } catch {}
}
const price = item.monthlyRent || item.MonthlyRent || item.dailyRent || item.DailyRent || 0;
const priceUnit = item.monthlyRent || item.MonthlyRent ? 'monthly' : 'daily';