Fix error handling for adding a record to the collection from artist page

This commit is contained in:
Claudio Ortolina
2025-06-09 18:32:27 +01:00
parent 8ac4a99df2
commit 4da5a8d59b
3 changed files with 8 additions and 1 deletions
@@ -176,7 +176,12 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|> put_flash(:info, gettext("Record added to the collection"))}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, form: to_form(changeset))}
{:noreply,
socket
|> put_flash(
:error,
gettext("Error importing record") <> "," <> inspect(changeset.errors)
)}
end
end
+1
View File
@@ -47,6 +47,7 @@ msgstr ""
msgid "Edit"
msgstr ""
#: lib/music_library_web/live/artist_live/show.ex
#: lib/music_library_web/live/collection_live/index.ex
#, elixir-autogen, elixir-format
msgid "Error importing record"
+1
View File
@@ -47,6 +47,7 @@ msgstr ""
msgid "Edit"
msgstr ""
#: lib/music_library_web/live/artist_live/show.ex
#: lib/music_library_web/live/collection_live/index.ex
#, elixir-autogen, elixir-format
msgid "Error importing record"