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"))}
|
|> put_flash(:info, gettext("Record added to the collection"))}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{: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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ msgstr ""
|
|||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#: lib/music_library_web/live/collection_live/index.ex
|
#: lib/music_library_web/live/collection_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Error importing record"
|
msgid "Error importing record"
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ msgstr ""
|
|||||||
msgid "Edit"
|
msgid "Edit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#: lib/music_library_web/live/collection_live/index.ex
|
#: lib/music_library_web/live/collection_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Error importing record"
|
msgid "Error importing record"
|
||||||
|
|||||||
Reference in New Issue
Block a user