Skip to content

Commit

Permalink
fix(api): support [] inside form names
Browse files Browse the repository at this point in the history
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]"
  • Loading branch information
lubber-de committed Nov 20, 2022
1 parent b4fc00c commit 1a3de4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/definitions/behaviors/api.js
Expand Up @@ -468,7 +468,9 @@ $.api = $.fn.api = function(parameters) {
} else {
pushValues[pushKey] = [pushValues[pushKey] , value];
}
value = pushValues[pushKey];
if(pushKey.indexOf('[]')===-1) {
value = pushValues[pushKey];
}

while ((k = nameKeys.pop()) !== undefined) {
// foo[]
Expand Down

0 comments on commit 1a3de4b

Please sign in to comment.