Skip to content

Commit 1a3de4b

Browse files
authored
fix(api): support [] inside form names
One case was not fetched in the new 2.9.0 api form serializer: When a named key has an array push in between the named key like "foo[][bar]"
1 parent b4fc00c commit 1a3de4b

File tree

1 file changed

+3
-1
lines changed
  • src/definitions/behaviors

1 file changed

+3
-1
lines changed

src/definitions/behaviors/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@ $.api = $.fn.api = function(parameters) {
468468
} else {
469469
pushValues[pushKey] = [pushValues[pushKey] , value];
470470
}
471-
value = pushValues[pushKey];
471+
if(pushKey.indexOf('[]')===-1) {
472+
value = pushValues[pushKey];
473+
}
472474

473475
while ((k = nameKeys.pop()) !== undefined) {
474476
// foo[]

0 commit comments

Comments
 (0)