forked from NYANDEV/forgejo
* trigger webhooks with api too * fix comment * notify report old too * CI restart * restart CI again * remove duplicated code
This commit is contained in:
parent
b51d7c459e
commit
9e6ad64d48
2 changed files with 44 additions and 36 deletions
|
@ -61,3 +61,18 @@ func RemoveLabel(issue *models.Issue, doer *models.User, label *models.Label) er
|
|||
notification.NotifyIssueChangeLabels(doer, issue, nil, []*models.Label{label})
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReplaceLabels removes all current labels and add new labels to the issue.
|
||||
func ReplaceLabels(issue *models.Issue, doer *models.User, labels []*models.Label) error {
|
||||
old, err := models.GetLabelsByIssueID(issue.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := issue.ReplaceLabels(labels, doer); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
notification.NotifyIssueChangeLabels(doer, issue, labels, old)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue