Fix: Use NEXT_PUBLIC_API_URL for all image URLs

This commit is contained in:
AutonetSellCar Deploy
2025-12-30 16:09:06 +09:00
parent a3d5339c84
commit 0ccc2f75c5
5 changed files with 240 additions and 4 deletions

View File

@@ -324,6 +324,8 @@ interface BannerCardProps {
height: number;
}
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
// 이미지 URL 변환 (로컬 경로는 백엔드 URL 추가)
const getImageUrl = (url: string): string => {
if (!url) return '';
@@ -331,7 +333,7 @@ const getImageUrl = (url: string): string => {
return url;
}
// 로컬 경로인 경우 백엔드 URL 추가
return `http://localhost:8000${url}`;
return `${API_BASE_URL}${url}`;
};
// Helper to get localized title/subtitle based on language