API: NotificationSubject show Issue/Pull State (#12901)
This commit is contained in:
parent
3f9eb93cc6
commit
2dbca92a0f
|
@ -354,6 +354,7 @@ func (n *Notification) APIFormat() *api.NotificationThread {
|
|||
if n.Issue != nil {
|
||||
result.Subject.Title = n.Issue.Title
|
||||
result.Subject.URL = n.Issue.APIURL()
|
||||
result.Subject.State = n.Issue.State()
|
||||
comment, err := n.Issue.GetLastComment()
|
||||
if err == nil && comment != nil {
|
||||
result.Subject.LatestCommentURL = comment.APIURL()
|
||||
|
@ -364,6 +365,7 @@ func (n *Notification) APIFormat() *api.NotificationThread {
|
|||
if n.Issue != nil {
|
||||
result.Subject.Title = n.Issue.Title
|
||||
result.Subject.URL = n.Issue.APIURL()
|
||||
result.Subject.State = n.Issue.State()
|
||||
comment, err := n.Issue.GetLastComment()
|
||||
if err == nil && comment != nil {
|
||||
result.Subject.LatestCommentURL = comment.APIURL()
|
||||
|
|
|
@ -25,6 +25,7 @@ type NotificationSubject struct {
|
|||
URL string `json:"url"`
|
||||
LatestCommentURL string `json:"latest_comment_url"`
|
||||
Type string `json:"type" binding:"In(Issue,Pull,Commit)"`
|
||||
State StateType `json:"state"`
|
||||
}
|
||||
|
||||
// NotificationCount number of unread notifications
|
||||
|
|
|
@ -13835,6 +13835,9 @@
|
|||
"type": "string",
|
||||
"x-go-name": "LatestCommentURL"
|
||||
},
|
||||
"state": {
|
||||
"$ref": "#/definitions/StateType"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"x-go-name": "Title"
|
||||
|
|
Loading…
Reference in New Issue