Skip to content

Commit 83078ed

Browse files
committed
Add const for 'scope-' prefix.
1 parent 7df700e commit 83078ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/indexer/issues/db/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func ToDBOptions(ctx context.Context, options *internal.SearchOptions) (*issue_m
3535
case internal.SortByDeadlineAsc:
3636
sortType = "nearduedate"
3737
default:
38-
if strings.HasPrefix(string(options.SortBy), "scope-") {
38+
if strings.HasPrefix(string(options.SortBy), issue_model.ScopeSortPrefix) {
3939
sortType = string(options.SortBy)
4040
} else {
4141
sortType = "newest"

modules/indexer/issues/dboptions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
102102
// Unsupported sort type for search
103103
fallthrough
104104
default:
105-
if strings.HasPrefix(opts.SortType, "scope-") {
105+
if strings.HasPrefix(opts.SortType, issues_model.ScopeSortPrefix) {
106106
searchOpt.SortBy = internal.SortBy(opts.SortType)
107107
} else {
108108
searchOpt.SortBy = SortByUpdatedDesc

0 commit comments

Comments
 (0)