Skip to content

Commit

Permalink
hotfix(TimetableController): don't sort ferry stops by route pattern (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen authored May 21, 2024
1 parent 8310b99 commit eb64d43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions lib/dotcom_web/controllers/schedule/timetable_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ defmodule DotcomWeb.ScheduleController.TimetableController do
},
required(:trip_stops) => [Stops.Stop.t()]
}
def build_timetable(%Conn{assigns: %{route: %Route{id: route_id, type: 4}}} = conn, schedules) do
trip_schedules = Map.new(schedules, &trip_schedule(&1))

trip_stops =
@stops_repo.by_route(route_id, conn.assigns.direction_id)

%{
trip_schedules: trip_schedules,
trip_stops: trip_stops
}
end

def build_timetable(conn, schedules) do
trip_schedules = Map.new(schedules, &trip_schedule(&1))
inbound? = conn.assigns.direction_id == 1
Expand Down
1 change: 0 additions & 1 deletion lib/routes/route.ex
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ defmodule Routes.Route do
def hidden?(%{id: "9702"}), do: true
def hidden?(%{id: "9703"}), do: true
def hidden?(%{id: "Logan-" <> _}), do: true
def hidden?(%{id: "CapeFlyer"}), do: true
def hidden?(%{id: "Boat-F3"}), do: true
def hidden?(_), do: false

Expand Down
3 changes: 1 addition & 2 deletions test/routes/route_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ defmodule Routes.RouteTest do
"9701",
"9702",
"9703",
"Logan-Airport",
"CapeFlyer"
"Logan-Airport"
]

for route_id <- hidden_routes do
Expand Down

0 comments on commit eb64d43

Please sign in to comment.