Don't add empty search parameters to global search engine

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-10-12 18:27:05 +02:00
parent ac7b994b6f
commit 76ff11ceae
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -70,7 +70,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
:count, :count,
:sortBy :sortBy
]) ])
|> Keyword.reject(fn {_key, val} -> is_nil(val) end) |> Keyword.reject(fn {_key, val} -> is_nil(val) or val == "" end)
events_url = "#{search_endpoint()}#{@search_events_api}?#{encode(options)}" events_url = "#{search_endpoint()}#{@search_events_api}?#{encode(options)}"
Logger.debug("Calling global search engine url #{events_url}") Logger.debug("Calling global search engine url #{events_url}")
@ -117,7 +117,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
:bbox, :bbox,
:sortBy :sortBy
]) ])
|> Keyword.reject(fn {_key, val} -> is_nil(val) end) |> Keyword.reject(fn {_key, val} -> is_nil(val) or val == "" end)
groups_url = "#{search_endpoint()}#{@search_groups_api}?#{encode(options)}" groups_url = "#{search_endpoint()}#{@search_groups_api}?#{encode(options)}"
Logger.debug("Calling global search engine url #{groups_url}") Logger.debug("Calling global search engine url #{groups_url}")