Skip to content

orderBy does not work in most cases #23

New issue

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

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

Already on GitHub? # to your account

Closed
eljenso opened this issue Sep 6, 2017 · 0 comments
Closed

orderBy does not work in most cases #23

eljenso opened this issue Sep 6, 2017 · 0 comments

Comments

@eljenso
Copy link
Contributor

eljenso commented Sep 6, 2017

The orderBy query does not work with single values (i.e. http://localhost:3000/player?orderBy=name).
This throws TypeError: orderBy.map is not a function because orderBy is not an array.

Also I can't order by an array (i.e. http://localhost:3000/player?orderBy[]=name).
This throws SyntaxError: Unexpected token a in JSON at position 1 because queryParser tries to `JSON.parse('name').

Looks like the API only supports queries like http://localhost:3000/player?orderBy[]=["name","ASC"].
This behavior does not fit with the docs of js-data where the other two types of queries are described.

I'm using js-data-express on the backend while using js-data-http on the frontend, both in v3.

This was referenced Sep 6, 2017
jmdobry pushed a commit that referenced this issue Sep 6, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant