This commit is contained in:
Thomas Citharel
2018-11-12 09:05:31 +01:00
parent 6e691640de
commit 5721c5fe05
16 changed files with 289 additions and 228 deletions

View File

@@ -885,7 +885,15 @@ defmodule Mobilizon.Events do
"""
def get_comment!(id), do: Repo.get!(Comment, id)
def get_comment_with_uuid!(uuid), do: Repo.get_by!(Comment, uuid: uuid)
def get_comment_from_uuid(uuid), do: Repo.get_by(Comment, uuid: uuid)
def get_comment_from_uuid!(uuid), do: Repo.get_by!(Comment, uuid: uuid)
def get_comment_full_from_uuid(uuid) do
with %Comment{} = comment <- Repo.get_by!(Comment, uuid: uuid) do
Repo.preload(comment, [:actor, :attributed_to])
end
end
def get_comment_from_url(url), do: Repo.get_by(Comment, url: url)