forked from potsda.mn/mobilizon
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)}
|
{:ok, conversation_to_view(conversation, conversation_participant_actor)}
|
||||||
|
|
||||||
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
|
{:error, changeset}
|
||||||
|
|
||||||
{:error, :empty_participants} ->
|
{:error, :empty_participants} ->
|
||||||
{:error,
|
{:error,
|
||||||
dgettext(
|
dgettext(
|
||||||
|
|
|
@ -133,6 +133,7 @@ const sendForm = (e: Event) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.debug("Sending new private message");
|
console.debug("Sending new private message");
|
||||||
if (!currentActor.value?.id || !event.value.id) return;
|
if (!currentActor.value?.id || !event.value.id) return;
|
||||||
|
errors.value = [];
|
||||||
eventPrivateMessageMutate({
|
eventPrivateMessageMutate({
|
||||||
text: text.value,
|
text: text.value,
|
||||||
actorId:
|
actorId:
|
||||||
|
@ -150,7 +151,10 @@ onEventPrivateMessageMutated(() => {
|
||||||
|
|
||||||
onEventPrivateMessageError((err) => {
|
onEventPrivateMessageError((err) => {
|
||||||
err.graphQLErrors.forEach((error) => {
|
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