Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expose arrow id for shuttle stops view #1012

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/arrow_web/controllers/api_html/stops_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ defmodule ArrowWeb.API.StopsView do
|> Map.take(@fields)
end

def id(stop, _conn), do: stop.stop_id
def id(stop, _conn), do: stop.id
end
12 changes: 6 additions & 6 deletions test/arrow_web/controllers/api/stops_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"stop_name" => stop1.stop_name,
"updated_at" => DateTime.to_iso8601(stop1.updated_at)
},
"id" => stop1.stop_id,
"id" => "#{stop1.id}",
"type" => "stops"
},
%{
Expand All @@ -54,7 +54,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"stop_name" => stop2.stop_name,
"updated_at" => DateTime.to_iso8601(stop2.updated_at)
},
"id" => stop2.stop_id,
"id" => "#{stop2.id}",
"type" => "stops"
},
%{
Expand All @@ -68,7 +68,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"stop_name" => stop3.stop_name,
"updated_at" => DateTime.to_iso8601(stop3.updated_at)
},
"id" => stop3.stop_id,
"id" => "#{stop3.id}",
"type" => "stops"
}
] == data
Expand Down Expand Up @@ -103,7 +103,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"at_street" => "At Avenue",
"on_street" => "On Street"
},
"id" => stop1.stop_id,
"id" => "#{stop1.id}",
"type" => "stops"
},
%{
Expand All @@ -118,7 +118,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"updated_at" => DateTime.to_iso8601(stop2.updated_at),
"at_street" => "At Avenue"
},
"id" => stop2.stop_id,
"id" => "#{stop2.id}",
"type" => "stops"
},
%{
Expand All @@ -133,7 +133,7 @@ defmodule ArrowWeb.API.StopsControllerTest do
"updated_at" => DateTime.to_iso8601(stop3.updated_at),
"on_street" => "On Street"
},
"id" => stop3.stop_id,
"id" => "#{stop3.id}",
"type" => "stops"
}
] == data
Expand Down
Loading