rails / request.js

MIT License
389 stars 28 forks source link

Allow lists in query strings #50

Closed dphaener closed 1 year ago

dphaener commented 1 year ago

There are use cases where you may want to add an array of values to a query string. I.E. ids[]=1&ids[]=2.

Previously the mergeEntries function was simply replacing any item in the search params with an identical name. This had the effect of only including the final entry in the params.

This updates the mergeEntires function to just do an append rather than a replace if the entry name contains [].

marcelolx commented 1 year ago

thanks @dphaener!