mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Penultimate round of db.DefaultContext
refactor (#27414)
Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -58,8 +58,8 @@ func (opts GetMilestonesOption) toCond() builder.Cond {
|
||||
}
|
||||
|
||||
// GetMilestones returns milestones filtered by GetMilestonesOption's
|
||||
func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error) {
|
||||
sess := db.GetEngine(db.DefaultContext).Where(opts.toCond())
|
||||
func GetMilestones(ctx context.Context, opts GetMilestonesOption) (MilestoneList, int64, error) {
|
||||
sess := db.GetEngine(ctx).Where(opts.toCond())
|
||||
|
||||
if opts.Page != 0 {
|
||||
sess = db.SetSessionPagination(sess, &opts)
|
||||
|
Reference in New Issue
Block a user