From 44de66bf50d1ab9a5acc298063cd942768092a19 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 14 Jan 2020 16:37:19 +0100 Subject: [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 --- modules/structs/notifications.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/structs') 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"` +} -- cgit v1.2.3