fix(images): resolve relative backend image URLs to absolute

API مسیرهای تصویر را نسبی برمی‌گرداند (/uploads/...) که next/image روی
دامنه localhost می‌جست و 404 می‌داد. helper جدید imageUrl مسیرهای نسبی
uploads را با NEXT_PUBLIC_API_URL کامل می‌کند (absolute و asset محلی
دست‌نخورده). اعمال روی لیست/جزئیات پزشک، نوبت، گالری کلینیک، آواتارها.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-15 00:44:27 +03:30
co-authored by Claude Opus 4.8
parent 05cf5fc585
commit e6570e06f6
10 changed files with 30 additions and 9 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
import Image from "next/image";
import { imageUrl } from "@/helper";
function Head({ doctor }) {
// تبدیل img array به string
const doctorImage = doctor?.img?.[0]?.url || "/default-doctor.jpg";
const doctorImage = imageUrl(doctor?.img?.[0]?.url, "/default-doctor.jpg");
// تبدیل specialties array به string
const expertiseText = doctor?.specialties