diff --git a/dashboard_api_rev.py b/dashboard_api_rev.py index d4dfc4c..6537e83 100644 --- a/dashboard_api_rev.py +++ b/dashboard_api_rev.py @@ -16,7 +16,8 @@ is the base URL (the `N8N_BASE` constant in each dashboard SPA): GET /webhook/live-positions?cost_centre=&acc_status= → { summary, geojson } (reporting.fn_live_positions) - GET /webhook/vehicle-track?vehicle_number=&hours= + GET /webhook/live-positions/track?vehicle_number=&hours= + (alias: /webhook/vehicle-track) → GeoJSON Feature (reporting.fn_vehicle_track) GET /webhook/fleet-dashboard → { drivers, cost_centres, cities, vehicles } (filter options) @@ -117,6 +118,10 @@ def live_positions(cost_centre: str | None = None, acc_status: str | None = None ) +# `/webhook/live-positions/track` is the path the Live Positions SPA actually +# calls; `/webhook/vehicle-track` is kept as an alias. Both hit the same handler +# so the only frontend change is the base URL (N8N_BASE). +@app.get("/webhook/live-positions/track") @app.get("/webhook/vehicle-track") def vehicle_track(vehicle_number: str | None = None, hours: int = 1): veh = _clean(vehicle_number)