Skip to content

orderBy does not work in most cases #23

Closed
@eljenso

Description

@eljenso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions