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}")}
{: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} ->
{:noreply,