Skip to content

Commit

Permalink
hotfix(Stops.Api): account for bus stops having facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Sep 11, 2024
1 parent acd4d50 commit 01c76d9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/stops/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ defmodule Stops.Api do
fare_facilities: fare_facilities,
bike_storage: bike_storage(item),
child?: child?(item),
station?: station?(item),
station?: item.attributes["location_type"] == 1,
has_fare_machine?: MapSet.member?(fare_facilities, :fare_vending_machine),
has_charlie_card_vendor?: MapSet.member?(fare_facilities, :fare_media_assistant),
latitude: item.attributes["latitude"],
Expand All @@ -179,11 +179,6 @@ defmodule Stops.Api do
{:ok, stop}
end

@spec station?(Item.t()) :: boolean
defp station?(%Item{} = item) do
item.attributes["location_type"] == 1 or item.relationships["facilities"] != []
end

defp type(%Item{attributes: %{"location_type" => 0}}) do
# A location where passengers board or disembark from a transit vehicle
:stop
Expand Down

0 comments on commit 01c76d9

Please sign in to comment.