improvement: fix & clarify logic in do_decode_path/4 (#35)

This commit is contained in:
kernel-io 2022-04-30 15:20:54 +12:00 committed by GitHub
parent 3829807631
commit 66a1b4002f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2418,7 +2418,7 @@ defmodule AshPhoenix.Form do
raise "Invalid Path: #{original_path}"
{key, config} ->
if config[:type] || :single == :single do
if Keyword.get(config, :type, :single) == :single do
[key | do_decode_path(form.forms[key], original_path, rest, config[:sparse?])]
else
[key | do_decode_path(form.forms[key] || [], original_path, rest, config[:sparse?])]