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

Allow to override Endpoint url method to handle objects in query params #2917

Closed
uxxman opened this issue Dec 31, 2023 · 3 comments · Fixed by #2919
Closed

Allow to override Endpoint url method to handle objects in query params #2917

uxxman opened this issue Dec 31, 2023 · 3 comments · Fixed by #2919
Labels
enhancement New feature or request

Comments

@uxxman
Copy link

uxxman commented Dec 31, 2023

Is your feature request related to a problem? Please describe.
Currently, this lib doesn't handle using deeply nested objects as query params. We need a way to allow the users to handle this on their own. As discussed here #348

@uxxman uxxman added the enhancement New feature or request label Dec 31, 2023
@ntucker
Copy link
Collaborator

ntucker commented Jan 1, 2024

On holidays ATM; but I will look at this end of week. Should be pretty easy. Thanks for the report!

@uxxman
Copy link
Author

uxxman commented Jan 1, 2024

no worries 😉 have a great week

@ntucker
Copy link
Collaborator

ntucker commented Jan 21, 2024

Example implementation using qs library for search parameter serialization

import { RestEndpoint, RestGenerics } from '@data-client/rest';
import qs from 'qs';

class QSEndpoint<O extends RestGenerics = any> extends RestEndpoint<O> {
  searchToString(searchParams) {
    return qs.stringify(searchParams);
  }
}

Released in 0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants