feat(api): add more sorting to own repository list (#7256)

- Add more sorting options, by leveraging the existing `repo_model.OrderByFlatMap` map, to the `/api/v1/user/repos` endpoint.
- Swagger has been updated.
- Add (non-exhaustive) integration testing.
- Ref: gitnex/GitNex#1266

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7256
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
Gusted 2025-03-17 20:03:24 +00:00 committed by Gusted
parent 9786982c6e
commit e2aa9adad7
3 changed files with 84 additions and 7 deletions

View file

@ -19361,8 +19361,28 @@
"in": "query"
},
{
"enum": [
"name",
"id",
"newest",
"oldest",
"recentupdate",
"leastupdate",
"reversealphabetically",
"alphabetically",
"reversesize",
"size",
"reversegitsize",
"gitsize",
"reverselfssize",
"lfssize",
"moststars",
"feweststars",
"mostforks",
"fewestforks"
],
"type": "string",
"description": "order the repositories by name (default), id, or size",
"description": "order the repositories",
"name": "order_by",
"in": "query"
}