mirror of
https://github.com/ash-project/ash_phoenix.git
synced 2024-09-20 07:12:49 +12:00
fix: add to path when is a map should be a list
This commit is contained in:
parent
968e1ad214
commit
ecfc918bf5
1 changed files with 4 additions and 4 deletions
|
@ -438,7 +438,7 @@ defmodule AshPhoenix do
|
|||
{changeset.data, []}
|
||||
end
|
||||
|
||||
changeset = mark_removed(changeset, new_value, key)
|
||||
changeset = mark_removed(changeset, new_value, (argument && argument.name) || rel.name)
|
||||
|
||||
{new_data, %{changeset | data: new_data}}
|
||||
end
|
||||
|
@ -661,9 +661,9 @@ defmodule AshPhoenix do
|
|||
value ++ List.wrap(add)
|
||||
end
|
||||
|
||||
# defp add_to_path(value, [key | rest], add) when is_integer(key) do
|
||||
# add_to_path([value], [key | rest], add)
|
||||
# end
|
||||
defp add_to_path(value, [], add) when is_map(value) do
|
||||
add_to_path([value], [], add)
|
||||
end
|
||||
|
||||
defp add_to_path(value, [key | rest], add) when is_integer(key) and is_list(value) do
|
||||
List.update_at(value, key, &add_to_path(&1, rest, add))
|
||||
|
|
Loading…
Reference in a new issue