diff options
Diffstat (limited to 'services/issue/issue.go')
-rw-r--r-- | services/issue/issue.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/issue/issue.go b/services/issue/issue.go index 5073dff819..b91ee4fc18 100644 --- a/services/issue/issue.go +++ b/services/issue/issue.go @@ -218,9 +218,16 @@ func deleteIssue(issue *issues_model.Issue) error { return err } - if err := repo_model.UpdateRepoIssueNumbers(ctx, issue.RepoID, issue.IsPull, issue.IsClosed); err != nil { + // update the total issue numbers + if err := repo_model.UpdateRepoIssueNumbers(ctx, issue.RepoID, issue.IsPull, false); err != nil { return err } + // if the issue is closed, update the closed issue numbers + if issue.IsClosed { + if err := repo_model.UpdateRepoIssueNumbers(ctx, issue.RepoID, issue.IsPull, true); err != nil { + return err + } + } if err := issues_model.UpdateMilestoneCounters(ctx, issue.MilestoneID); err != nil { return fmt.Errorf("error updating counters for milestone id %d: %w", |