Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

[API] pull notification subject status: add "merged" (#15344)

Current subject status can be "", "open" and "closed". This add "merged" to it.
This commit is contained in:
6543 2021-04-09 03:36:23 +02:00 committed by GitHub
parent 9a2553920f
commit 147826a577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,11 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
if err == nil && comment != nil {
result.Subject.LatestCommentURL = comment.APIURL()
}
pr, _ := n.Issue.GetPullRequest()
if pr != nil && pr.HasMerged {
result.Subject.State = "merged"
}
}
case models.NotificationSourceCommit:
result.Subject = &api.NotificationSubject{