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
@@ -5,6 +5,7 @@ import GreenCalendarTurn from "@/components/icons/GreenCalendarTurn";
import { Button } from "@mui/material";
import Image from "next/image";
import Link from "next/link";
import { imageUrl } from "@/helper";
function ItemAppointment({ turn, loading, doctorSlug }) {
return (
@@ -21,7 +22,7 @@ function ItemAppointment({ turn, loading, doctorSlug }) {
width={56}
height={56}
alt="doctor"
src={turn?.img[0]?.url}
src={imageUrl(turn?.img?.[0]?.url)}
/>
</CircularLoading>
<div className="flex flex-col items-start justify-center gap-2">
+2 -1
View File
@@ -5,6 +5,7 @@ import LikeDI from "@/components/icons/LikeDI";
import StarDI from "@/components/icons/StarDI";
import TickCircle from "@/components/icons/TickCircle";
import Image from "next/image";
import { imageUrl } from "@/helper";
function Title({ doctor }) {
return (
@@ -16,7 +17,7 @@ function Title({ doctor }) {
w-[40px] sm:w-[81px] md:w-[123px] lg:w-[164px]
h-[40px] sm:h-[81px] md:h-[123px] lg:h-[164px]
"
src={doctor?.img?.[0]?.url || "/assets/images/user.png"}
src={imageUrl(doctor?.img?.[0]?.url)}
alt="img-doctor"
height={164}
width={164}
+2 -1
View File
@@ -1,10 +1,11 @@
import Image from "next/image";
import { imageUrl } from "@/helper";
function ImageProfile({ data }) {
return (
<div className="bg-stroke-circle ml-[10px] mt-[57px] p-[9px] rounded-full overflow-hidden">
<Image
src={data?.img[0]?.url}
src={imageUrl(data?.img?.[0]?.url)}
width={173}
height={173}
alt="profile-user"