diff options
author | Giteabot <teabot@gitea.io> | 2023-07-12 01:22:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 13:22:17 +0800 |
commit | 052e65e63f6c3af517c89edff40a97b33c9a29e1 (patch) | |
tree | 7ec6ad3cafaf137e7cca02c4aed2c918ea702e36 /routers | |
parent | c1a10be07e1af2d1af6dfe9dc470a5f2da5a0eae (diff) | |
download | gitea-052e65e63f6c3af517c89edff40a97b33c9a29e1.tar.gz gitea-052e65e63f6c3af517c89edff40a97b33c9a29e1.zip |
Fix incorrect oldest sort in project list (#25806) (#25835)
Backport #25806 by @yp05327
sort type `oldest` should be `Asc`.
Added a test for this.
I see we have `SearchOrderBy` in db model, but we are using many
different ways to define the sort type.
~Maybe we can improve this later.~
↑ Improved in this PR
Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/org/projects.go | 2 | ||||
-rw-r--r-- | routers/web/repo/projects.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index 4b33d943b3..be1bb2721d 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -61,7 +61,7 @@ func Projects(ctx *context.Context) { OwnerID: ctx.ContextUser.ID, Page: page, IsClosed: util.OptionalBoolOf(isShowClosed), - SortType: sortType, + OrderBy: project_model.GetSearchOrderByBySortType(sortType), Type: projectType, }) if err != nil { diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 066cdbc5fd..6bfb21c134 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -74,7 +74,7 @@ func Projects(ctx *context.Context) { RepoID: repo.ID, Page: page, IsClosed: util.OptionalBoolOf(isShowClosed), - SortType: sortType, + OrderBy: project_model.GetSearchOrderByBySortType(sortType), Type: project_model.TypeRepository, }) if err != nil { |