diff options
author | 6543 <6543@obermui.de> | 2021-07-01 12:51:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 12:51:24 +0200 |
commit | dfa18a8b1c8614f0827d6d2b91171a540a2ca3be (patch) | |
tree | a99960ca7b9f0d35e2ccd80cd421899655fea6c3 /modules/convert | |
parent | ce286f9d9c00ceb24fb4eab4cab56c0b0678765a (diff) | |
download | gitea-dfa18a8b1c8614f0827d6d2b91171a540a2ca3be.tar.gz gitea-dfa18a8b1c8614f0827d6d2b91171a540a2ca3be.zip |
Introduce NotifySubjectType (#16320)
* Introduce NotifySubjectType
* update swagger docs
Diffstat (limited to 'modules/convert')
-rw-r--r-- | modules/convert/notification.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/convert/notification.go b/modules/convert/notification.go index cc941678b6..b0888ee09f 100644 --- a/modules/convert/notification.go +++ b/modules/convert/notification.go @@ -27,7 +27,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { //handle Subject switch n.Source { case models.NotificationSourceIssue: - result.Subject = &api.NotificationSubject{Type: "Issue"} + result.Subject = &api.NotificationSubject{Type: api.NotifySubjectIssue} if n.Issue != nil { result.Subject.Title = n.Issue.Title result.Subject.URL = n.Issue.APIURL() @@ -38,7 +38,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { } } case models.NotificationSourcePullRequest: - result.Subject = &api.NotificationSubject{Type: "Pull"} + result.Subject = &api.NotificationSubject{Type: api.NotifySubjectPull} if n.Issue != nil { result.Subject.Title = n.Issue.Title result.Subject.URL = n.Issue.APIURL() @@ -55,13 +55,13 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { } case models.NotificationSourceCommit: result.Subject = &api.NotificationSubject{ - Type: "Commit", + Type: api.NotifySubjectCommit, Title: n.CommitID, URL: n.Repository.HTMLURL() + "/commit/" + n.CommitID, } case models.NotificationSourceRepository: result.Subject = &api.NotificationSubject{ - Type: "Repository", + Type: api.NotifySubjectRepository, Title: n.Repository.FullName(), URL: n.Repository.Link(), } |