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,
: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)}"
Logger.debug("Calling global search engine url #{events_url}")
@ -117,7 +117,7 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
:bbox,
: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)}"
Logger.debug("Calling global search engine url #{groups_url}")