[PR #3964] [MERGED] api: repos/search: add parameters to control the sort order #17169

Closed
opened 2025-11-02 12:28:11 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/3964
Author: @aswild
Created: 5/14/2018
Status: Merged
Merged: 8/2/2018
Merged by: @lunny

Base: masterHead: repo-search-sort


📝 Commits (6)

  • bc20878 api: repos/search: add parameters to control the sort order
  • 4922691 Merge branch 'master' into repo-search-sort
  • 07f463f Merge branch 'master' into repo-search-sort
  • 5d21d47 Merge branch 'master' into repo-search-sort
  • b959a21 Merge branch 'master' of git://github.com/go-gitea/gitea into repo-search-sort
  • 49d97de Merge branch 'master' of git://github.com/go-gitea/gitea into repo-search-sort

📊 Changes

2 files changed (+59 additions, -0 deletions)

View changed files

📝 routers/api/v1/repo/repo.go (+47 -0)
📝 templates/swagger/v1_json.tmpl (+12 -0)

📄 Description

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': 0 for ascending or 1 for descending

'order' defaults to ascending, and is only used when 'sort' is also specified.
The overall default behavior is unchanged (alphabetically ascending).

This partially implements issue #3963

Signed-off-by: Allen Wild allenwild93@gmail.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/3964 **Author:** [@aswild](https://github.com/aswild) **Created:** 5/14/2018 **Status:** ✅ Merged **Merged:** 8/2/2018 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `repo-search-sort` --- ### 📝 Commits (6) - [`bc20878`](https://github.com/go-gitea/gitea/commit/bc208783ccf3e167902e3d505d4927dcc121c158) api: repos/search: add parameters to control the sort order - [`4922691`](https://github.com/go-gitea/gitea/commit/492269142867c63df19a4988c36048431af03772) Merge branch 'master' into repo-search-sort - [`07f463f`](https://github.com/go-gitea/gitea/commit/07f463f5c0fb106520248207909ad86b6f1cecd5) Merge branch 'master' into repo-search-sort - [`5d21d47`](https://github.com/go-gitea/gitea/commit/5d21d4797373ca92c2a851dc2b3300a0b634ec7a) Merge branch 'master' into repo-search-sort - [`b959a21`](https://github.com/go-gitea/gitea/commit/b959a218752b5066634339d480a4e954d93df572) Merge branch 'master' of git://github.com/go-gitea/gitea into repo-search-sort - [`49d97de`](https://github.com/go-gitea/gitea/commit/49d97de4dc2ed862767efb0d6f6ec7cf64db913a) Merge branch 'master' of git://github.com/go-gitea/gitea into repo-search-sort ### 📊 Changes **2 files changed** (+59 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `routers/api/v1/repo/repo.go` (+47 -0) 📝 `templates/swagger/v1_json.tmpl` (+12 -0) </details> ### 📄 Description 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': 0 for ascending or 1 for descending 'order' defaults to ascending, and is only used when 'sort' is also specified. The overall default behavior is unchanged (alphabetically ascending). This partially implements issue #3963 Signed-off-by: Allen Wild <allenwild93@gmail.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:28:11 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17169