From eb72248e16b03ce3a87876e1b7b0d96965d648c6 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 14 Jan 2021 11:39:01 +0100 Subject: [PATCH] Revert "fix search results sorted by id instead of by begins_on" This reverts commit a133612d9fa3dc6026fbcd07f9f452352f36ae0b. --- lib/mobilizon/events/events.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 916efc70..9d679294 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -520,8 +520,7 @@ defmodule Mobilizon.Events do |> events_for_tags(args) |> events_for_location(args) |> filter_local_or_from_followed_instances_events() - |> filter_public_visibility() - |> event_order_begins_on_asc() + |> order_by([q], asc: q.id) |> Page.build_page(page, limit) end @@ -1342,6 +1341,8 @@ defmodule Mobilizon.Events do @spec events_for_search_query(String.t()) :: Ecto.Query.t() defp events_for_search_query(search_string) do Event + |> where([e], e.visibility == ^:public) + |> distinct([e], e.id) |> do_event_for_search_query(search_string) end