Order my group upcoming events by begins_on
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
147ea64483
commit
9aaea50f59
|
@ -16,7 +16,7 @@ defmodule Mobilizon.FollowedGroupActivity do
|
||||||
) :: Page.t(Event.t())
|
) :: Page.t(Event.t())
|
||||||
def user_followed_group_events(user_id, after_datetime \\ nil, page \\ nil, limit \\ nil) do
|
def user_followed_group_events(user_id, after_datetime \\ nil, page \\ nil, limit \\ nil) do
|
||||||
Event
|
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(: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, p], pa in Actor, on: p.actor_id == pa.id)
|
||||||
|> join(:inner, [e], g in Actor, on: e.attributed_to_id == g.id)
|
|> join(:inner, [e], g in Actor, on: e.attributed_to_id == g.id)
|
||||||
|
|
Loading…
Reference in a new issue