From 9aaea50f594bd8826d4dd6bda4d00e76599f89f1 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 24 Nov 2021 09:28:59 +0100 Subject: [PATCH] Order my group upcoming events by begins_on Signed-off-by: Thomas Citharel --- lib/mobilizon/followed_group_activity.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobilizon/followed_group_activity.ex b/lib/mobilizon/followed_group_activity.ex index e13863c59..4045aa05d 100644 --- a/lib/mobilizon/followed_group_activity.ex +++ b/lib/mobilizon/followed_group_activity.ex @@ -16,7 +16,7 @@ defmodule Mobilizon.FollowedGroupActivity do ) :: Page.t(Event.t()) def user_followed_group_events(user_id, after_datetime \\ nil, page \\ nil, limit \\ nil) do Event - |> distinct([e], e.id) + |> distinct([e], [e.begins_on, e.id]) |> join(:left, [e], p in Participant, on: e.id == p.event_id) |> join(:inner, [_e, p], pa in Actor, on: p.actor_id == pa.id) |> join(:inner, [e], g in Actor, on: e.attributed_to_id == g.id)