Introduce backend for reports

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-23 13:49:22 +02:00
parent 33a8da4570
commit aef841e192
36 changed files with 2028 additions and 36 deletions

View File

@@ -1160,6 +1160,19 @@ defmodule Mobilizon.Events do
end
end
@doc """
Get all comments by an actor and a list of ids
"""
def get_all_comments_by_actor_and_ids(actor_id, comment_ids \\ [])
def get_all_comments_by_actor_and_ids(_actor_id, []), do: []
def get_all_comments_by_actor_and_ids(actor_id, comment_ids) do
Comment
|> where([c], c.id in ^comment_ids)
|> where([c], c.actor_id == ^actor_id)
|> Repo.all()
end
@doc """
Creates a comment.