added the descption
All checks were successful
Build frontend / build (push) Successful in 47s

This commit is contained in:
mouazkh
2026-05-26 17:49:39 +03:00
parent 13a0649806
commit 9c79e0648b

View File

@ -228,18 +228,20 @@ export default function PropertyDetailsPage() {
getMySaleListings(), getMySaleListings(),
]); ]);
const myPropIds = new Set(); const myPropIds = new Set();
const addIds = (items) => { const collectIds = (result) => {
if (!Array.isArray(items)) return; if (result.status !== 'fulfilled' || !result.value) return;
items.forEach(p => { const list = Array.isArray(result.value) ? result.value : [result.value];
list.forEach(p => {
const info = p.propertyInformation || {}; const info = p.propertyInformation || {};
if (info.id) myPropIds.add(info.id); if (info.id) myPropIds.add(Number(info.id));
if (p.id) myPropIds.add(p.id); if (p.id) myPropIds.add(Number(p.id));
}); });
}; };
if (myRent.status === 'fulfilled') addIds(myRent.value); collectIds(myRent);
if (mySale.status === 'fulfilled') addIds(mySale.value); collectIds(mySale);
const propInfoId = mapped._raw?.propertyInformationId || mapped.id; const checkId = Number(mapped.id) || mapped.id;
if (myPropIds.has(propInfoId) || myPropIds.has(mapped.id)) { const checkInfoId = Number(mapped._raw?.propertyInformation?.id) || mapped._raw?.propertyInformation?.id;
if (myPropIds.has(checkId) || (checkInfoId && myPropIds.has(checkInfoId))) {
setIsOwnProperty(true); setIsOwnProperty(true);
} }
} catch {} } catch {}