From fd0a480ed2eda645d5a58d860fe2a9611f6f743f Mon Sep 17 00:00:00 2001 From: AutonetSellCar Deploy Date: Sun, 1 Feb 2026 21:25:24 +0900 Subject: [PATCH] fix: Add getImageUrl to handle relative image paths in MyRequest page --- frontend/src/app/my-request/page.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/my-request/page.tsx b/frontend/src/app/my-request/page.tsx index 05e9239..65e61ee 100644 --- a/frontend/src/app/my-request/page.tsx +++ b/frontend/src/app/my-request/page.tsx @@ -9,6 +9,18 @@ import { useAuthStore } from '@/lib/store'; import { vehicleRequestsApi, VehicleRequestWithVehicles, DirectPurchasedCar } from '@/lib/api'; import SidebarLayout from '@/components/SidebarLayout'; +const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || ''; + +// 이미지 URL 변환 (로컬 경로는 백엔드 URL 추가) +const getImageUrl = (url: string | undefined): string => { + if (!url) return ''; + if (url.startsWith('http://') || url.startsWith('https://')) { + return url; + } + // 로컬 경로인 경우 백엔드 URL 추가 + return `${API_BASE_URL}${url}`; +}; + export default function MyRequestPage() { const router = useRouter(); const { t, language } = useTranslation(); @@ -226,7 +238,7 @@ export default function MyRequestPage() {
{carData?.main_image ? ( {carData.car_name {carData?.main_image ? (