File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -480,8 +480,24 @@ export const IncidentData = () => {
480480 longitude
481481 ) ;
482482
483+ // Handle different photo formats (Supabase vs old format)
484+ let imageUrl ;
485+ if ( typeof incident . photo === "object" && incident . photo !== null ) {
486+ // Supabase storage format
487+ imageUrl =
488+ incident . photo . signedURL ||
489+ incident . photo . signedUrl ||
490+ incident . photo . url ;
491+ } else if ( typeof incident . photo === "string" ) {
492+ // Old format or direct URL
493+ imageUrl = incident . photo ;
494+ } else {
495+ console . error ( "Invalid photo format:" , incident . photo ) ;
496+ return ;
497+ }
498+
483499 const payload = {
484- image_name : incident . photo ,
500+ image_name : imageUrl ,
485501 sensitive_structures : sensitiveStructures ,
486502 incident_id : incidentId ,
487503 user_id : userId ,
You can’t perform that action at this time.
0 commit comments