fix: Configure proper API URLs for production and development
- Add .env.production with production API URL (https://litter-api.psbailey.uk/api) - Create getApiBaseUrl() helper function for static assets - Update ReportDetailModal to use dynamic API URL - Fix default API port to 3005 across all services - Images will now load correctly in both dev and production
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { useState } from 'react';
|
||||
import type { ReportResponseDTO } from '@/types';
|
||||
import { format } from 'date-fns';
|
||||
import { getApiBaseUrl } from '@/services/api';
|
||||
|
||||
interface ReportDetailModalProps {
|
||||
report: ReportResponseDTO;
|
||||
@@ -128,7 +129,7 @@ export function ReportDetailModal({ report, isOpen, onClose, onVerify, onDispute
|
||||
src={
|
||||
report.photoUrls[currentPhotoIndex].startsWith('http')
|
||||
? report.photoUrls[currentPhotoIndex]
|
||||
: `http://localhost:3005${report.photoUrls[currentPhotoIndex]}`
|
||||
: `${getApiBaseUrl()}${report.photoUrls[currentPhotoIndex]}`
|
||||
}
|
||||
alt={`Report photo ${currentPhotoIndex + 1}`}
|
||||
className="w-full h-80 object-contain"
|
||||
|
||||
Reference in New Issue
Block a user