diff options
Diffstat (limited to 'models/issues/milestone.go')
-rw-r--r-- | models/issues/milestone.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/models/issues/milestone.go b/models/issues/milestone.go index 9db7cb2b15..eb42df8263 100644 --- a/models/issues/milestone.go +++ b/models/issues/milestone.go @@ -289,9 +289,7 @@ func DeleteMilestoneByRepoID(ctx context.Context, repoID, id int64) error { } defer committer.Close() - sess := db.GetEngine(ctx) - - if _, err = sess.ID(m.ID).Delete(new(Milestone)); err != nil { + if _, err = db.DeleteByID[Milestone](ctx, m.ID); err != nil { return err } @@ -311,7 +309,7 @@ func DeleteMilestoneByRepoID(ctx context.Context, repoID, id int64) error { repo.NumMilestones = int(numMilestones) repo.NumClosedMilestones = int(numClosedMilestones) - if _, err = sess.ID(repo.ID).Cols("num_milestones, num_closed_milestones").Update(repo); err != nil { + if _, err = db.GetEngine(ctx).ID(repo.ID).Cols("num_milestones, num_closed_milestones").Update(repo); err != nil { return err } |