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

Make addQueryToURL more full featured #50

Open
gustavoguichard opened this issue Mar 7, 2024 · 3 comments
Open

Make addQueryToURL more full featured #50

gustavoguichard opened this issue Mar 7, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gustavoguichard
Copy link
Owner

I'd like to construct a QS as complex as 'filter[0]["key"]=value&filter[0]["op"]=gte&filter[0]["value"]=0' out of an object like:

addQueryToURL(`http://localhost:3000`,  { filter: [{ key: "value", op: "gte", value: 0 }] });
@gustavoguichard gustavoguichard added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 7, 2024
@Mario-aj
Copy link

Mario-aj commented Jun 13, 2024

What do you think about having something like this: 'filter["key"]=value&filter["op"]=gte&filter["value"]=0? There might be a specific reason for how you're positioning the filters, and if that's the case, please let me know.

How would you expect those filters to appear in the url response?

@gustavoguichard
Copy link
Owner Author

Hey @Mario-aj, thank you for showing interest!

There's no pattern when it comes to this problem. That is why Id rather follow the same behavior as the qs library. It is also the exact inverse of composable-functions' inputFromSearch if you'd like to see a smaller code.

@Mario-aj
Copy link

Hey @gustavoguichard, thanks for the recommendation! I'll definitely check out these libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants