Fix error handling for adding a record to the collection from artist page
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user