Skip to content

Commit

Permalink
check for subway
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Jul 10, 2024
1 parent 78dff58 commit 6a2f5c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/alerts/alert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ defmodule Alerts.Alert do

defp set_direction_ids(%__MODULE__{} = alert), do: alert

defp set_direction_id(%InformedEntity{} = entity) do
defp set_direction_id(%InformedEntity{direction_id: nil, route_type: 1} = entity) do
stop = Stops.Repo.get(entity.stop)

if entity.direction_id == nil && stop.child_ids == [] do
if stop.child_ids == [] do
direction_id =
stop.id
|> RoutePatterns.Repo.by_stop_id()
Expand All @@ -166,6 +166,8 @@ defmodule Alerts.Alert do
end
end

defp set_direction_id(entity), do: entity

@spec set_priority(map) :: map
defp set_priority(%__MODULE__{} = alert) do
%__MODULE__{alert | priority: Priority.priority(alert)}
Expand Down

0 comments on commit 6a2f5c0

Please sign in to comment.