Skip to content

Commit

Permalink
chore: unwrap list data
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Jul 13, 2023
1 parent fdd0f07 commit 021d2fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ash_phoenix/form/auto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,11 @@ defmodule AshPhoenix.Form.Auto do
:single ->
fn parent ->
if parent do
Map.get(parent, attr.name)
case Map.get(parent, attr.name) do
[value | _] -> value
[] -> nil
value -> value
end
end
end
end
Expand Down

0 comments on commit 021d2fb

Please sign in to comment.