diff --git a/backend/main.py b/backend/main.py index d74bc06..915548f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -2353,13 +2353,18 @@ async def accident_records( return { "id": r.id, - "submitted_at": r.submitted_at.isoformat() if r.submitted_at else None, + # Submitted time formatted as "YYYY-MM-DD HH:MM:SS" (display-friendly) + "submitted_at": r.submitted_at.strftime("%Y-%m-%d %H:%M:%S") if r.submitted_at else None, "date": r.date.isoformat() if r.date else None, "time": r.time, "incident_datetime": incident_dt, # YYYY-MM-DD HH:MM:SS combined "location": r.location, - "employee_name": r.submitter_email, - "employee_id": r.injured_person_id, + # Backend alias: frontend column_order uses submitter_email as key + # but legacy UI expected employee_name + "submitter_email": r.submitter_email, + "employee_name": r.submitter_email, # alias for backward compat + "injured_person_id": r.injured_person_id, + "employee_id": r.injured_person_id, # alias "department": r.department, "description": r.description, "severity": r.severity,