mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
api: repos/search: add parameters to control the sort order (#3964)
The backend SearchRepositoryByName function supports several sort order options, hook these up to the /repos/search API. New parameters for /repos/search: 'sort': alpha, created, updated, size, or id 'order': asc or desc 'sort' defaults to alpha. 'order' defaults to ascending, and is ignored if 'sort' is not specified. The overall default behavior is unchanged (alphabetically ascending). This partially implements issue #3963 Signed-off-by: Allen Wild <allenwild93@gmail.com>
This commit is contained in:
@@ -985,6 +985,18 @@
|
||||
"description": "if `uid` is given, search only for repos that the user owns",
|
||||
"name": "exclusive",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\"",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
Reference in New Issue
Block a user