Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: array params not being built correctly #22

Merged
merged 4 commits into from
Mar 10, 2021

Conversation

ComfortablyCoding
Copy link
Owner

All URI parameters should be one name and one value pair, but their can be multiple parameters with the same name.

buildSearchParams now utilizes this behavior for array values and add a name and value pair for each element in the array.

For example

"statuses[]": ["in progress", "completed"]

will now become

statuses%5B%5D=in+progress&statuses%5B%5D=completed

Fixes #21.

All URI parameters should be one name and one value pair, but their can be multiple parameters with the same name.

We utilize this behavior for array values and add a name and value pair for each element in the array.

For example

'statuses[]': ["in progress", "completed"]

will become

statuses%5B%5D=in+progress&statuses%5B%5D=completed

FIXES: #21
As the method does not use 'this' it can be made into a static one.
- update method call to static version.
- update description to specify only buildSearchParams is being tested in this block.
@ComfortablyCoding ComfortablyCoding changed the title fix: array params not being build correctly fix: array params not being built correctly Mar 10, 2021
@ComfortablyCoding ComfortablyCoding merged commit 7a227e0 into master Mar 10, 2021
@ComfortablyCoding ComfortablyCoding deleted the fix-array-params branch March 10, 2021 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use getTasks in lists.js
1 participant