forked from forgejo/forgejo
backport #26128 to fix some serious bug. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
parent
a8445e9320
commit
bc73e6a85c
3 changed files with 66 additions and 307 deletions
|
@ -241,7 +241,10 @@ func GetSearchOrderByBySortType(sortType string) db.SearchOrderBy {
|
|||
|
||||
// FindProjects returns a list of all projects that have been created in the repository
|
||||
func FindProjects(ctx context.Context, opts SearchOptions) ([]*Project, int64, error) {
|
||||
e := db.GetEngine(ctx).Where(opts.toConds()).OrderBy(opts.OrderBy.String())
|
||||
e := db.GetEngine(ctx).Where(opts.toConds())
|
||||
if opts.OrderBy.String() != "" {
|
||||
e = e.OrderBy(opts.OrderBy.String())
|
||||
}
|
||||
projects := make([]*Project, 0, setting.UI.IssuePagingNum)
|
||||
|
||||
if opts.Page > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue