Fix inconsistent toast arity in form components

Closes #94
This commit is contained in:
Claudio Ortolina
2026-03-05 17:06:23 +00:00
parent 494996c4fb
commit 4b1f6bb245
5 changed files with 20 additions and 30 deletions
@@ -92,10 +92,8 @@ defmodule MusicLibraryWeb.ScrobbleRulesLive.Form do
{:ok, scrobble_rule} ->
notify_parent({:updated, scrobble_rule})
{:noreply,
socket
|> put_toast(:info, gettext("Scrobble rule updated successfully"))
|> push_patch(to: socket.assigns.patch)}
put_toast!(:info, gettext("Scrobble rule updated successfully"))
{:noreply, push_patch(socket, to: socket.assigns.patch)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, form: to_form(changeset))}
@@ -107,10 +105,8 @@ defmodule MusicLibraryWeb.ScrobbleRulesLive.Form do
{:ok, scrobble_rule} ->
notify_parent({:created, scrobble_rule})
{:noreply,
socket
|> put_toast(:info, gettext("Scrobble rule created successfully"))
|> push_patch(to: socket.assigns.patch)}
put_toast!(:info, gettext("Scrobble rule created successfully"))
{:noreply, push_patch(socket, to: socket.assigns.patch)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, form: to_form(changeset))}