mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-16 06:26:13 +00:00
1582b1e83a
Backport #30784 by @6543 instead of: - zowner/gcode - awesome/nul - zowner/nul - zowner/zzz we will get: - awesome/nul - zowner/gcode - zowner/nul - zowner/zzz Co-authored-by: 6543 <6543@obermui.de> (cherry picked from commit cfe6779d4eb2f3869357768fe58863642f79c5a9)
25 lines
691 B
Go
25 lines
691 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package repo
|
|
|
|
import "code.gitea.io/gitea/models/db"
|
|
|
|
// SearchOrderByMap represents all possible search order
|
|
var SearchOrderByMap = map[string]map[string]db.SearchOrderBy{
|
|
"asc": {
|
|
"alpha": "owner_name ASC, name ASC",
|
|
"created": db.SearchOrderByOldest,
|
|
"updated": db.SearchOrderByLeastUpdated,
|
|
"size": db.SearchOrderBySize,
|
|
"id": db.SearchOrderByID,
|
|
},
|
|
"desc": {
|
|
"alpha": "owner_name DESC, name DESC",
|
|
"created": db.SearchOrderByNewest,
|
|
"updated": db.SearchOrderByRecentUpdated,
|
|
"size": db.SearchOrderBySizeReverse,
|
|
"id": db.SearchOrderByIDReverse,
|
|
},
|
|
}
|