fix(backend): Fix Mobilizon.Events.list_participations_for_user_query/1

Multiple on: following two join: declarations were not taken into account

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-04-19 11:56:41 +02:00
parent 3f5e39cd7a
commit bcf6fd893c
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -1755,15 +1755,11 @@ defmodule Mobilizon.Events do
@spec list_participations_for_user_query(integer()) :: Ecto.Query.t()
defp list_participations_for_user_query(user_id) do
from(
p in Participant,
join: e in Event,
join: a in Actor,
on: p.actor_id == a.id,
on: p.event_id == e.id,
where: a.user_id == ^user_id and p.role != ^:not_approved,
preload: [:event, :actor]
)
Participant
|> join(:inner, [p], e in Event, on: p.event_id == e.id)
|> join(:inner, [p], a in Actor, on: p.actor_id == a.id)
|> where([p, _e, a], a.user_id == ^user_id and p.role != ^:not_approved)
|> preload([:event, :actor])
end
@spec feed_token_query(String.t()) :: Ecto.Query.t()