Credo fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-07-09 15:23:18 +02:00
parent b6659cae84
commit a87bbfc52a
2 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ defmodule Eventos.Events do
import Geo.PostGIS 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})") ip_point = Geo.WKT.decode("SRID=4326;POINT(#{lon} #{lat})")
Repo.all( Repo.all(
from e in Event, from e in Event,

View File

@ -19,8 +19,8 @@ defmodule EventosWeb.EventController do
Logger.debug(inspect city) Logger.debug(inspect city)
Logger.debug(inspect [latitude, longitude]) Logger.debug(inspect [latitude, longitude])
distance = case city do distance = case city do
nil -> 500000 nil -> 500_000
_ -> 50000 _ -> 50_000
end end
events = Events.find_close_events(longitude, latitude, distance) 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) render(conn, "index.json", events: events, coord: %{longitude: longitude, latitude: latitude, distance: distance}, city: city, country: country)