million-views / praas

Proxy as a service.
MIT License
4 stars 2 forks source link

Implement sort feature in the backend #167

Closed kavithaii closed 4 years ago

kavithaii commented 4 years ago

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

NOTE: reduced original scope from sort and search to sort only. We'll take up search in another issue.