Fix photo URL construction in ReportDetailModal
- Prepend API base URL to relative photo paths - Use process.cwd() for upload directory in server - Ensures photos display correctly in report detail modal
This commit is contained in:
@@ -125,7 +125,11 @@ export function ReportDetailModal({ report, isOpen, onClose, onVerify, onDispute
|
||||
{/* Photo Gallery */}
|
||||
<div className="relative bg-gray-900">
|
||||
<img
|
||||
src={report.photoUrls[currentPhotoIndex]}
|
||||
src={
|
||||
report.photoUrls[currentPhotoIndex].startsWith('http')
|
||||
? report.photoUrls[currentPhotoIndex]
|
||||
: `${(import.meta.env.VITE_API_BASE_URL || 'http://localhost:3005/api').replace('/api', '')}${report.photoUrls[currentPhotoIndex]}`
|
||||
}
|
||||
alt={`Report photo ${currentPhotoIndex + 1}`}
|
||||
className="w-full h-80 object-contain"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user