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

Blueprints doesn't support multiple sort #2449

Closed
Dallas62 opened this issue Nov 27, 2014 · 2 comments
Closed

Blueprints doesn't support multiple sort #2449

Dallas62 opened this issue Nov 27, 2014 · 2 comments

Comments

@Dallas62
Copy link
Contributor

Hi!

Actualiy, blueprints doesn't parse sort argument as json or by splitting string,
so we can't do something like:
/model/?sort=foo ASC, bar DESC
/model/?sort=[ 'foo ASC', 'bar DESC']
/model/?sort={ 'foo': 'ASC', 'bar': 'DESC'}
/model/?sort={ 'foo': 1, 'bar': 0}

His there any purpose to do it well?
Maybe a PR soon.

Dallas62 pushed a commit to Dallas62/sails that referenced this issue Nov 27, 2014
Hi!

This PR add multiple sort support on blueprints

Basic usage of `?sort=foo ASC` still working
and add JSON support like `?sort={foo: 'ASC', bar: 'DESC'}` (basically same parameter than Waterline)

As refered balderdashy#2449
@sgress454
Copy link
Member

Good idea @Dallas62. Added support for JSON sort options in 636284e

Note it must be proper JSON (with double-quotes) for it to work.

@sgress454
Copy link
Member

Somehow missed that you had a PR to do this exact thing. Sorry about that, wasn't intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants