diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js index ede78f4..f3a7cfe 100644 --- a/app/owner/properties/page.js +++ b/app/owner/properties/page.js @@ -749,7 +749,7 @@ export default function OwnerPropertiesPage() { 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']; + return raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/'}${img}`) : ['/property-placeholder.jpg']; })(), createdAt: item.createdAt || new Date().toISOString(), furnished: details.furnished || false, diff --git a/app/page.js b/app/page.js index 8598a30..20ea1e5 100644 --- a/app/page.js +++ b/app/page.js @@ -55,7 +55,7 @@ function mapApiProperty(item, index) { const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 - ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/'}${img}`) : ['/property-placeholder.jpg']; return { diff --git a/app/properties/page.js b/app/properties/page.js index eb20922..3396f32 100644 --- a/app/properties/page.js +++ b/app/properties/page.js @@ -57,7 +57,7 @@ function mapApiProperty(item, index) { const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 - ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/'}${img}`) : ['/property-placeholder.jpg']; return { diff --git a/app/property/[id]/page.js b/app/property/[id]/page.js index b6bb4aa..22bfbe4 100644 --- a/app/property/[id]/page.js +++ b/app/property/[id]/page.js @@ -74,7 +74,7 @@ function mapApiDetail(item) { const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 - ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/'}${img}`) : ['/property-placeholder.jpg', '/villa1.jpg', '/villa2.jpg']; return {