From 98c3f51df27ae4128d33503c9d309417a980a2d0 Mon Sep 17 00:00:00 2001 From: Claw AI Date: Tue, 31 Mar 2026 22:48:50 +0000 Subject: [PATCH] fix: switch API base URL to HTTPS (nip.io) --- app/owner/properties/page.js | 2 +- app/page.js | 2 +- app/properties/page.js | 2 +- app/property/[id]/PropertyDetail.js | 2 +- app/utils/api.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js index 1e4c485..d996986 100644 --- a/app/owner/properties/page.js +++ b/app/owner/properties/page.js @@ -747,7 +747,7 @@ export default function OwnerPropertiesPage() { livingRooms: details.livingRooms || 0, status: { 0: 'available', 1: 'booked', 2: 'maintenance' }[info.status] || 'available', images: (() => { - const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; + const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'https://45.93.137.91.nip.io/api') : ''; const raw = Array.isArray(info.images) ? info.images : []; return raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg']; })(), diff --git a/app/page.js b/app/page.js index aa7d7a8..6659a53 100644 --- a/app/page.js +++ b/app/page.js @@ -52,7 +52,7 @@ function mapApiProperty(item, index) { if (info.numberOfBathRooms) features.push(`${info.numberOfBathRooms} حمامات`); // Extract images from API and build full URLs - const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; + const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'https://45.93.137.91.nip.io/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) diff --git a/app/properties/page.js b/app/properties/page.js index ee43ced..874b082 100644 --- a/app/properties/page.js +++ b/app/properties/page.js @@ -57,7 +57,7 @@ function mapApiProperty(item, index) { if (info.numberOfBathRooms) features.push(`${info.numberOfBathRooms} حمامات`); // Extract images from API and build full URLs - const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; + const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'https://45.93.137.91.nip.io/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) diff --git a/app/property/[id]/PropertyDetail.js b/app/property/[id]/PropertyDetail.js index b624d9b..63da9fb 100644 --- a/app/property/[id]/PropertyDetail.js +++ b/app/property/[id]/PropertyDetail.js @@ -97,7 +97,7 @@ function mapApiDetail(item) { const typeLabels = { 0: 'شقة', 1: 'فيلا', 2: 'بيت' }; // Extract images from API and build full URLs - const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api') : ''; + const apiBase = typeof window !== 'undefined' ? (process.env.NEXT_PUBLIC_API_URL || 'https://45.93.137.91.nip.io/api') : ''; const rawImages = Array.isArray(info.images) ? info.images : []; const images = rawImages.length > 0 ? rawImages.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) diff --git a/app/utils/api.js b/app/utils/api.js index 9051bde..bf44686 100644 --- a/app/utils/api.js +++ b/app/utils/api.js @@ -1,6 +1,6 @@ import AuthService from '../services/AuthService'; -const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://45.93.137.91/api'; +const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'https://45.93.137.91.nip.io/api'; /** * Generic API fetch — attaches auth token, unwraps { data } envelope