2023-05-08 12:36:54 +03:00
|
|
|
// 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": {
|
2024-05-06 18:06:45 +03:00
|
|
|
"alpha": "owner_name ASC, name ASC",
|
2023-05-08 12:36:54 +03:00
|
|
|
"created": db.SearchOrderByOldest,
|
|
|
|
"updated": db.SearchOrderByLeastUpdated,
|
|
|
|
"size": db.SearchOrderBySize,
|
|
|
|
"id": db.SearchOrderByID,
|
|
|
|
},
|
|
|
|
"desc": {
|
2024-05-06 18:06:45 +03:00
|
|
|
"alpha": "owner_name DESC, name DESC",
|
2023-05-08 12:36:54 +03:00
|
|
|
"created": db.SearchOrderByNewest,
|
|
|
|
"updated": db.SearchOrderByRecentUpdated,
|
|
|
|
"size": db.SearchOrderBySizeReverse,
|
|
|
|
"id": db.SearchOrderByIDReverse,
|
|
|
|
},
|
|
|
|
}
|