File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -658,9 +658,27 @@ defmodule Ash.CodeInterface do
658658 arg_params = unquote ( arg_params )
659659
660660 params =
661- if is_list ( params ) ,
662- do: Enum . map ( params , & Map . merge ( & 1 , arg_params ) ) ,
663- else: Map . merge ( params , arg_params )
661+ if is_list ( params ) do
662+ Enum . map ( params , fn item ->
663+ if is_map ( item ) do
664+ Map . merge ( item , arg_params )
665+ else
666+ raise ArgumentError , """
667+ Expected `params` to be a map or a list of maps.
668+ Got: #{ inspect ( params ) }
669+ """
670+ end
671+ end )
672+ else
673+ if is_map ( params ) do
674+ Map . merge ( params , arg_params )
675+ else
676+ raise ArgumentError , """
677+ Expected `params` to be a map or a list of maps.
678+ Got: #{ inspect ( params ) }
679+ """
680+ end
681+ end
664682
665683 case Enum . filter ( unquote ( interface . exclude_inputs || [ ] ) , fn input ->
666684 if is_list ( params ) do
You can’t perform that action at this time.
0 commit comments