From 6c235f4959455fee8c9a08744c03431587757502 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 3 May 2024 16:52:18 +0800 Subject: [PATCH] Perform Newest sort type correctly when sorting issues (#30644) (#30847) Backport #30644 by kemzeb Should resolve #30642. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com> --- modules/indexer/issues/dboptions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/indexer/issues/dboptions.go b/modules/indexer/issues/dboptions.go index a3b18fdcd1..4b42a4ea4f 100644 --- a/modules/indexer/issues/dboptions.go +++ b/modules/indexer/issues/dboptions.go @@ -68,7 +68,7 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp searchOpt.Paginator = opts.Paginator switch opts.SortType { - case "": + case "", "latest": searchOpt.SortBy = SortByCreatedDesc case "oldest": searchOpt.SortBy = SortByCreatedAsc @@ -86,7 +86,7 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp searchOpt.SortBy = SortByDeadlineDesc case "priority", "priorityrepo", "project-column-sorting": // Unsupported sort type for search - searchOpt.SortBy = SortByUpdatedDesc + fallthrough default: searchOpt.SortBy = SortByUpdatedDesc }