diff options
author | 6543 <6543@obermui.de> | 2020-01-14 16:37:19 +0100 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2020-01-14 16:37:19 +0100 |
commit | 44de66bf50d1ab9a5acc298063cd942768092a19 (patch) | |
tree | fda1b76b954d720dfdfefded22883a51ab52e45e /modules/structs | |
parent | ce274d652f2be03364bc0d0a8cb1b4d1996b16c7 (diff) | |
download | gitea-44de66bf50d1ab9a5acc298063cd942768092a19.tar.gz gitea-44de66bf50d1ab9a5acc298063cd942768092a19.zip |
[API] add endpoint to check notifications [Extend #9488] (#9595)
* introduce GET /notifications/new
* add TEST
* use Sprintf instead of path.Join
* Error more verbose
* return number of notifications if unreaded exist
* 200 http status for available notifications
Diffstat (limited to 'modules/structs')
-rw-r--r-- | modules/structs/notifications.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/structs/notifications.go b/modules/structs/notifications.go index b1e8b7781c..b6c9774a97 100644 --- a/modules/structs/notifications.go +++ b/modules/structs/notifications.go @@ -26,3 +26,8 @@ type NotificationSubject struct { LatestCommentURL string `json:"latest_comment_url"` Type string `json:"type" binding:"In(Issue,Pull,Commit)"` } + +// NotificationCount number of unread notifications +type NotificationCount struct { + New int64 `json:"new"` +} |