Fix some warnings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

fix error

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

Fix tests and warnings

Move process_geom/2 to addresses where it belongs
Create a special error view for invalid requests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

credo fix

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-21 19:43:16 +01:00
parent adf1888fc7
commit 22093b8ca4
8 changed files with 77 additions and 34 deletions

View File

@@ -7,6 +7,7 @@ defmodule EventosWeb.EventController do
alias Eventos.Events
alias Eventos.Events.Event
alias Eventos.Export.ICalendar
alias Eventos.Addresses
action_fallback EventosWeb.FallbackController
@@ -26,12 +27,11 @@ defmodule EventosWeb.EventController do
end
defp process_address(address) do
geom = EventosWeb.AddressController.process_geom(address["geom"])
case geom do
nil ->
address
_ ->
case Addresses.process_geom(address["geom"]) do
{:ok, geom} ->
%{address | "geom" => geom}
_ ->
address
end
end