fix(announcements): error message not showing when an event announcement is created with empty text
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
9207d76712
commit
ef20585f8c
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue