From 0171c7a2bf08bf24046c0eefe2dd8b323ad42684 Mon Sep 17 00:00:00 2001 From: Claw AI Date: Mon, 30 Mar 2026 18:52:08 +0000 Subject: [PATCH] fix: prepend /Pictures/ to image paths for nginx static serving --- app/owner/properties/page.js | 2 +- app/page.js | 2 +- app/properties/page.js | 2 +- app/property/[id]/PropertyDetail.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js index f3a7cfe..cbb80d2 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.startsWith('/') ? '' : '/'}${img}`) : ['/property-placeholder.jpg']; + return raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${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 20ea1e5..aa7d7a8 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.startsWith('/') ? '' : '/'}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg']; return { diff --git a/app/properties/page.js b/app/properties/page.js index 7304f40..ee43ced 100644 --- a/app/properties/page.js +++ b/app/properties/page.js @@ -60,7 +60,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.startsWith('/') ? '' : '/'}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg']; return { diff --git a/app/property/[id]/PropertyDetail.js b/app/property/[id]/PropertyDetail.js index 9cae800..b624d9b 100644 --- a/app/property/[id]/PropertyDetail.js +++ b/app/property/[id]/PropertyDetail.js @@ -100,7 +100,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.startsWith('/') ? '' : '/'}${img}`) + ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg', '/villa1.jpg', '/villa2.jpg']; return {