|
|
@ -182,6 +182,17 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com |
|
|
|
} |
|
|
|
} |
|
|
|
issue.IsClosed = true |
|
|
|
issue.IsClosed = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = issue.GetLabels(); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for _, label := range issue.Labels { |
|
|
|
|
|
|
|
label.NumClosedIssues++ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = UpdateLabel(label); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = UpdateIssue(issue); err != nil { |
|
|
|
if err = UpdateIssue(issue); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} else if err = UpdateIssueUserPairsByStatus(issue.Id, issue.IsClosed); err != nil { |
|
|
|
} else if err = UpdateIssueUserPairsByStatus(issue.Id, issue.IsClosed); err != nil { |
|
|
@ -230,6 +241,17 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com |
|
|
|
} |
|
|
|
} |
|
|
|
issue.IsClosed = false |
|
|
|
issue.IsClosed = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = issue.GetLabels(); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for _, label := range issue.Labels { |
|
|
|
|
|
|
|
label.NumClosedIssues-- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err = UpdateLabel(label); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = UpdateIssue(issue); err != nil { |
|
|
|
if err = UpdateIssue(issue); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} else if err = UpdateIssueUserPairsByStatus(issue.Id, issue.IsClosed); err != nil { |
|
|
|
} else if err = UpdateIssueUserPairsByStatus(issue.Id, issue.IsClosed); err != nil { |
|
|
|