Parent issue
#475
Overview
Update the HeritageCard React component to point <img src> at the backend proxy endpoint instead of the raw UNESCO URL.
Implementation
// Build proxy URL from the record's primary key
const backendApiUrl = `${process.env.NEXT_PUBLIC_API_BASE_URL}/api/heritage-image/${item.id}`;
// In JSX, replace the existing <img> with:
{item.id && !isImgError ? (
<img
src={backendApiUrl}
alt={title}
className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
crossOrigin="anonymous"
onError={() => setIsImgError(true)}
/>
) : (
// existing placeholder SVG
)}
Acceptance criteria
<img src> points to /api/heritage-image/{id} (via env var base URL)
crossOrigin="anonymous" is set
onError still triggers the placeholder fallback
Parent issue
#475
Overview
Update the
HeritageCardReact component to point<img src>at the backend proxy endpoint instead of the raw UNESCO URL.Implementation
Acceptance criteria
<img src>points to/api/heritage-image/{id}(via env var base URL)crossOrigin="anonymous"is setonErrorstill triggers the placeholder fallback