mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +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:
parent
0abb5633e3
commit
537fa69962
14 changed files with 149 additions and 222 deletions
|
@ -295,16 +295,15 @@ func DeleteMilestoneByRepoID(ctx context.Context, repoID, id int64) error {
|
|||
return err
|
||||
}
|
||||
|
||||
numMilestones, err := CountMilestones(ctx, GetMilestonesOption{
|
||||
numMilestones, err := db.Count[Milestone](ctx, FindMilestoneOptions{
|
||||
RepoID: repo.ID,
|
||||
State: api.StateAll,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
numClosedMilestones, err := CountMilestones(ctx, GetMilestonesOption{
|
||||
RepoID: repo.ID,
|
||||
State: api.StateClosed,
|
||||
numClosedMilestones, err := db.Count[Milestone](ctx, FindMilestoneOptions{
|
||||
RepoID: repo.ID,
|
||||
IsClosed: util.OptionalBoolTrue,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue