Surface duplicate importing error in collection

This commit is contained in:
Claudio Ortolina
2024-11-27 11:11:36 +00:00
parent c1e06d9e66
commit ccff972aa0
2 changed files with 9 additions and 2 deletions
@@ -116,7 +116,13 @@ defmodule MusicLibraryWeb.CollectionLive.Index do
|> push_navigate(to: ~p"/collection/#{record.id}")} |> push_navigate(to: ~p"/collection/#{record.id}")}
{: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)
)
|> push_patch(to: ~p"/collection")}
{:error, reason} -> {:error, reason} ->
{:noreply, {:noreply,
+2 -1
View File
@@ -81,7 +81,8 @@ msgstr ""
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: lib/music_library_web/live/collection_live/index.ex:124 #: lib/music_library_web/live/collection_live/index.ex:123
#: lib/music_library_web/live/collection_live/index.ex:130
#: lib/music_library_web/live/stats_live/index.ex:67 #: lib/music_library_web/live/stats_live/index.ex:67
#: lib/music_library_web/live/stats_live/index.ex:73 #: lib/music_library_web/live/stats_live/index.ex:73
#: lib/music_library_web/live/wishlist_live/index.ex:120 #: lib/music_library_web/live/wishlist_live/index.ex:120