diff --git a/lib/graphql/resolvers/conversation.ex b/lib/graphql/resolvers/conversation.ex index 5ee79cf4a..b4c1bbcc7 100644 --- a/lib/graphql/resolvers/conversation.ex +++ b/lib/graphql/resolvers/conversation.ex @@ -156,6 +156,9 @@ defmodule Mobilizon.GraphQL.Resolvers.Conversation do {:ok, conversation_to_view(conversation, conversation_participant_actor)} + {:error, %Ecto.Changeset{} = changeset} -> + {:error, changeset} + {:error, :empty_participants} -> {:error, dgettext( diff --git a/src/components/Participation/NewPrivateMessage.vue b/src/components/Participation/NewPrivateMessage.vue index 6491a8d48..914133d8e 100644 --- a/src/components/Participation/NewPrivateMessage.vue +++ b/src/components/Participation/NewPrivateMessage.vue @@ -133,6 +133,7 @@ const sendForm = (e: Event) => { e.preventDefault(); console.debug("Sending new private message"); if (!currentActor.value?.id || !event.value.id) return; + errors.value = []; eventPrivateMessageMutate({ text: text.value, actorId: @@ -150,7 +151,10 @@ onEventPrivateMessageMutated(() => { onEventPrivateMessageError((err) => { err.graphQLErrors.forEach((error) => { - errors.value.push(error.message); + const message = Array.isArray(error.message) + ? error.message + : [error.message]; + errors.value.push(...message); }); });