Skip to content

Commit

Permalink
fix(TimetableController): fix for stops without zones (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen authored Mar 20, 2024
1 parent 53410bd commit e575c6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dotcom_web/controllers/schedule/timetable_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ defmodule DotcomWeb.ScheduleController.TimetableController do
end

defp zone_to_sortable("1A", _), do: 0
defp zone_to_sortable(zone, 0), do: String.to_integer(zone)
defp zone_to_sortable(zone, 1), do: -String.to_integer(zone)
defp zone_to_sortable(zone, 0) when is_binary(zone), do: String.to_integer(zone)
defp zone_to_sortable(zone, 1) when is_binary(zone), do: -String.to_integer(zone)
defp zone_to_sortable(_, _), do: 0

# translate each stop into a general stop_sequence value a given stop will
# have a different value for stop_sequence depending on the other stops in the
Expand Down

0 comments on commit e575c6e

Please sign in to comment.