Skip to content

Commit

Permalink
fix: don't multiply error messages (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgraff authored Oct 10, 2023
1 parent 31920db commit c93c606
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/ash_phoenix/form/form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3509,8 +3509,7 @@ defmodule AshPhoenix.Form do
|> Enum.map(fn error ->
%{error | path: trail ++ error.path}
end)

further_errors = further_errors ++ Enum.reject(errors, &(&1.path == trail))
|> Enum.filter(&(&1.path == trail))

new_forms =
form.forms
Expand All @@ -3525,12 +3524,12 @@ defmodule AshPhoenix.Form do
synthesize_action_errors(
form,
trail ++ [config[:for] || key, index],
further_errors
errors
)
end)
else
if forms do
synthesize_action_errors(forms, trail ++ [config[:for] || key], further_errors)
synthesize_action_errors(forms, trail ++ [config[:for] || key], errors)
end
end

Expand Down

0 comments on commit c93c606

Please sign in to comment.