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

Sort resource and search results #3

Open
donavon opened this issue May 3, 2020 · 2 comments
Open

Sort resource and search results #3

donavon opened this issue May 3, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@donavon
Copy link

donavon commented May 3, 2020

I'd like to make a feature request. It would be nice if you could sort the results from a resource and a search. For example, search for https://swapi.dev/api/people/?search=a and you will get 58 results, but only the first 10 are returned. So any UI would likely display these items with a "next page" button. They appear to be sorted by ID, making the order of the pages meaningless, and even a bit confusing to the user.

I'd like to see something like ?sort=[name:asc, hair_color:desc] (ie. sort first by name in ascending order, then by hair color in descending order).

Or at a very minimum sort=asc, which would sort by the "main" field in ascending order. The "main" field would likely be name or title.

If this were JavaScript, I'd submit a PR myself.

Thought?

@donavon
Copy link
Author

donavon commented May 3, 2020

I did a little poking around and found this package which could help https://github.com/AltSchool/dynamic-rest

@sploitfaze
Copy link

@Juriy Juriy added the enhancement New feature or request label Jun 17, 2021
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

No branches or pull requests

3 participants