Show a proper error message on creating/updating an event

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-10-09 16:07:13 +02:00
parent 9430f1145f
commit 75fc1f125a
3 changed files with 14 additions and 3 deletions

View File

@@ -219,7 +219,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
def update_event(
_parent,
%{event_id: event_id} = args,
%{context: %{current_user: user}} = _resolution
%{context: %{current_user: %User{} = user}} = _resolution
) do
# See https://github.com/absinthe-graphql/absinthe/issues/490
with args <- Map.put(args, :options, args[:options] || %{}),