Credo fixes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
e170aa7f66
commit
27d294ba6d
|
@ -57,7 +57,7 @@ defmodule Eventos.Events do
|
|||
|
||||
import Geo.PostGIS
|
||||
|
||||
def find_close_events(lon, lat, radius \\ 50000) do # 50 000 meters -> 50 kms
|
||||
def find_close_events(lon, lat, radius \\ 50_000) do # 50 000 meters -> 50 kms
|
||||
ip_point = Geo.WKT.decode("SRID=4326;POINT(#{lon} #{lat})")
|
||||
Repo.all(
|
||||
from e in Event,
|
||||
|
|
|
@ -19,8 +19,8 @@ defmodule EventosWeb.EventController do
|
|||
Logger.debug(inspect city)
|
||||
Logger.debug(inspect [latitude, longitude])
|
||||
distance = case city do
|
||||
nil -> 500000
|
||||
_ -> 50000
|
||||
nil -> 500_000
|
||||
_ -> 50_000
|
||||
end
|
||||
events = Events.find_close_events(longitude, latitude, distance)
|
||||
render(conn, "index.json", events: events, coord: %{longitude: longitude, latitude: latitude, distance: distance}, city: city, country: country)
|
||||
|
|
Loading…
Reference in New Issue