Fix unavailable access to an event

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-08 21:31:47 +02:00
parent 6b91d85bdc
commit 7a453b4329
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -45,6 +45,9 @@ defmodule MobilizonWeb.Resolvers.Event do
end
end
defp find_private_event(_parent, %{uuid: uuid}, _resolution),
do: {:error, "Event with UUID #{uuid} not found"}
def find_event(parent, %{uuid: uuid} = args, resolution) do
case {:has_event, Mobilizon.Events.get_public_event_by_uuid_with_preload(uuid)} do
{:has_event, %Event{} = event} ->