Display property images from API using full URLs
All checks were successful
Build frontend / build (push) Successful in 1m3s

- All mappers extract images from propertyInformation.images
- Paths prefixed with API base URL (http://45.93.137.91/api)
- Falls back to placeholder if no images
- Updated: main page, properties listing, property detail, owner properties
This commit is contained in:
Claw AI
2026-03-30 01:01:42 +00:00
parent 4299968764
commit 39193337b3
5 changed files with 69 additions and 42 deletions

View File

@ -746,7 +746,11 @@ export default function OwnerPropertiesPage() {
area: info.space || 0,
livingRooms: details.livingRooms || 0,
status: { 0: 'available', 1: 'booked', 2: 'maintenance' }[info.status] || 'available',
images: ['/property-placeholder.jpg'],
images: (() => {
const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : '';
const raw = Array.isArray(info.images) ? info.images : [];
return raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img}`) : ['/property-placeholder.jpg'];
})(),
createdAt: item.createdAt || new Date().toISOString(),
furnished: details.furnished || false,
description: info.description || '',