mirror of
https://github.com/strapi/strapi.git
synced 2025-08-12 18:53:23 +00:00
Merge pull request #400 from strapi/documentation/filter_sort
Improve documentation for sorting filters
This commit is contained in:
commit
d3b68aa5c8
@ -41,7 +41,8 @@ Sort according to a specific field.
|
||||
|
||||
Sort users by email.
|
||||
|
||||
`GET /user?_sort=email`
|
||||
- ASC: `GET /user?_sort=asc:email` or `GET /user?_sort=email`
|
||||
- DESC: `GET /user?_sort=desc:email` or `GET /user?_sort=-email`
|
||||
|
||||
### Limit
|
||||
|
||||
|
@ -479,7 +479,7 @@ module.exports = function(strapi) {
|
||||
break;
|
||||
case '_sort':
|
||||
result.key = `sort`;
|
||||
result.value = (value === 'desc') ? '-' : '';
|
||||
result.value = (_.toLower(value) === 'desc') ? '-' : '';
|
||||
result.value += key;
|
||||
break;
|
||||
case '_start':
|
||||
|
@ -350,7 +350,7 @@ module.exports = function (strapi) {
|
||||
break;
|
||||
case '_sort':
|
||||
result.key = `sort`;
|
||||
result.value = (value === 'desc') ? '-' : '';
|
||||
result.value = (_.toLower(value) === 'desc') ? '-' : '';
|
||||
result.value += key;
|
||||
break;
|
||||
case '_start':
|
||||
|
Loading…
x
Reference in New Issue
Block a user