Implement sort feature in the backend
Closed this issue · 0 comments
Users should be able to sort conduits and account users in the conduit.app
. To support the UI, the resource-server
API will support sort
query parameter. The format of sort
is described below starting with examples:
GET /users?sort=name:asc
GET /conduits?sort=createdAt:desc
Multiple sort fields are supported. Fields are "comma-separated" and sort order for a field is "colon-separated".
Example:
GET /conduits?sort=createdAt:desc,description:asc
When the server gets the request from the client via query parameter “sort”, the server returns data array of the response ordered according to the criteria specified. The server will apply default sorting to the data is the request parameter “sort” is not specified, also when “sort” does not have valid sort fields.
Acceptance Criteria
- GET all in rest layer needs query update to support sort
- Write tests to handle the sort functionality
NOTE: reduced original scope from sort and search to sort only. We'll take up search in another issue.