Skip to content

Commit

Permalink
fixed form errors issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cblavier committed Sep 24, 2022
1 parent 3ae2f32 commit 6c0c34d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/phx_component_helpers/forms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ defmodule PhxComponentHelpers.Forms do

@doc false
def form_errors(form, field) when not is_nil(form) and not is_nil(field) do
Keyword.get_values(form.errors, field)
case form.errors do
nil -> []
errors -> Keyword.get_values(errors, field)
end
end
end

0 comments on commit 6c0c34d

Please sign in to comment.