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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Array of Objects in toQueryString method #15

Open
vincediegane opened this issue Dec 29, 2023 · 0 comments
Open

Support Array of Objects in toQueryString method #15

vincediegane opened this issue Dec 29, 2023 · 0 comments

Comments

@vincediegane
Copy link

Issue: Support Array of Objects in toQueryString

Problem 馃

Hi master Babs !
The current implementation of toQueryString doesn't handle arrays of objects in a user-friendly way.

Example 馃摑

const query = {
  'persons': [
    { 'id': 0, 'name': 'john' },
    { 'id': 1, 'name': 'alice' }
  ],
  'cars': [
    { 'id': 0, 'name': 'audi' },
    { 'id': 1, 'name': 'tesla' }
  ];

toQueryString(query);

Expected Result 馃幆

"?cars=id:0,name:audi,id:1,name:tesla&persons=id:0,name:john,id:1,name:alice"

Actual Result 馃く

"?cars=[object Object],[object Object]&persons=[object Object],[object Object]"
@vincediegane vincediegane changed the title Support Array of Objects Support Array of Objects in toQueryString method Dec 29, 2023
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

No branches or pull requests

1 participant