You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nested objects like page aren't parsed like expected, resulting in an URL like /organisations?page=%5Bobject%20Object%5D&sort=id instead of /organisations?page[page]=1&page[itemsPerPage]=20&sort=id
I can think of 3 solutions to this issue:
use a library like qs and make the formatting of the output configurable.
Remove the getOptionsQuery method and let the API client deal with the parsing instead by passing the params to the .get method: return this.api.get(url, options). 👈
The text was updated successfully, but these errors were encountered:
Niels-NTG
changed the title
Options query should be parsed recursively and allow custom formats
[Feature Request] Options query should be parsed recursively and allow custom formats
Jun 25, 2019
When supplying a request with an
option
object like this:nested objects like
page
aren't parsed like expected, resulting in an URL like/organisations?page=%5Bobject%20Object%5D&sort=id
instead of/organisations?page[page]=1&page[itemsPerPage]=20&sort=id
I can think of 3 solutions to this issue:
getOptionsQuery
method and let the API client deal with the parsing instead by passing the params to the.get
method:return this.api.get(url, options)
. 👈getOptionsQuery
method overridable so people can replace it with their own parsing functions. Something like this:The text was updated successfully, but these errors were encountered: