mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Second part of refactor db.Find
(#28194)
Continue of #27798 and move more functions to `db.Find` and `db.Count`.
This commit is contained in:
@@ -212,13 +212,26 @@ func Milestones(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
counts, err := issues_model.CountMilestonesByRepoCondAndKw(ctx, userRepoCond, keyword, isShowClosed)
|
||||
counts, err := issues_model.CountMilestonesMap(ctx, issues_model.FindMilestoneOptions{
|
||||
RepoCond: userRepoCond,
|
||||
Name: keyword,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("CountMilestonesByRepoIDs", err)
|
||||
return
|
||||
}
|
||||
|
||||
milestones, err := issues_model.SearchMilestones(ctx, repoCond, page, isShowClosed, sortType, keyword)
|
||||
milestones, err := db.Find[issues_model.Milestone](ctx, issues_model.FindMilestoneOptions{
|
||||
ListOptions: db.ListOptions{
|
||||
Page: page,
|
||||
PageSize: setting.UI.IssuePagingNum,
|
||||
},
|
||||
RepoCond: repoCond,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
SortType: sortType,
|
||||
Name: keyword,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("SearchMilestones", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user