Merge branch 'fix-geocoding' into 'master'
Fix geocoding See merge request framasoft/mobilizon!454
This commit is contained in:
commit
4ff936ad7a
|
@ -42,7 +42,7 @@ export const CONFIG = gql`
|
||||||
location {
|
location {
|
||||||
latitude
|
latitude
|
||||||
longitude
|
longitude
|
||||||
accuracyRadius
|
# accuracyRadius
|
||||||
}
|
}
|
||||||
maps {
|
maps {
|
||||||
tiles {
|
tiles {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface IConfig {
|
||||||
location: {
|
location: {
|
||||||
latitude: number;
|
latitude: number;
|
||||||
longitude: number;
|
longitude: number;
|
||||||
accuracyRadius: number;
|
// accuracyRadius: number;
|
||||||
};
|
};
|
||||||
anonymous: {
|
anonymous: {
|
||||||
participation: {
|
participation: {
|
||||||
|
|
|
@ -3,8 +3,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
||||||
Handles the config-related GraphQL calls.
|
Handles the config-related GraphQL calls.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
alias Geolix.Adapter.MMDB2.Record.{Country, Location}
|
|
||||||
|
|
||||||
alias Mobilizon.Config
|
alias Mobilizon.Config
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
@ -15,13 +13,13 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
||||||
|
|
||||||
country_code =
|
country_code =
|
||||||
case Map.get(geolix, :city) do
|
case Map.get(geolix, :city) do
|
||||||
%{country: %Country{iso_code: country_code}} -> String.downcase(country_code)
|
%{country: %{iso_code: country_code}} -> String.downcase(country_code)
|
||||||
_ -> nil
|
_ -> nil
|
||||||
end
|
end
|
||||||
|
|
||||||
location =
|
location =
|
||||||
case Map.get(geolix, :city) do
|
case Map.get(geolix, :city) do
|
||||||
%{location: %Location{} = location} -> Map.from_struct(location)
|
%{location: %{} = location} -> location
|
||||||
_ -> nil
|
_ -> nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
||||||
object :lonlat do
|
object :lonlat do
|
||||||
field(:longitude, :float)
|
field(:longitude, :float)
|
||||||
field(:latitude, :float)
|
field(:latitude, :float)
|
||||||
field(:accuracy_radius, :integer)
|
# field(:accuracy_radius, :integer)
|
||||||
end
|
end
|
||||||
|
|
||||||
object :geocoding do
|
object :geocoding do
|
||||||
|
|
Loading…
Reference in a new issue