From 76ff11ceae7c73998f04bc2b2f9b5bcd5896c68e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 12 Oct 2022 18:27:05 +0200 Subject: [PATCH] Don't add empty search parameters to global search engine Signed-off-by: Thomas Citharel --- lib/service/global_search/search_mobilizon.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/service/global_search/search_mobilizon.ex b/lib/service/global_search/search_mobilizon.ex index 238a722d..4347263e 100644 --- a/lib/service/global_search/search_mobilizon.ex +++ b/lib/service/global_search/search_mobilizon.ex @@ -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}")