Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
build
.DS_Store
18 changes: 17 additions & 1 deletion src/Fonctions/Incident_fonction.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,24 @@ export const IncidentData = () => {
longitude
);

// Handle different photo formats (Supabase vs old format)
let imageUrl;
if (typeof incident.photo === "object" && incident.photo !== null) {
// Supabase storage format
imageUrl =
incident.photo.signedURL ||
incident.photo.signedUrl ||
incident.photo.url;
} else if (typeof incident.photo === "string") {
// Old format or direct URL
imageUrl = incident.photo;
} else {
console.error("Invalid photo format:", incident.photo);
return;
}

const payload = {
image_name: incident.photo,
image_name: imageUrl,
sensitive_structures: sensitiveStructures,
incident_id: incidentId,
user_id: userId,
Expand Down
Loading