From 0dadea19bcc469937d0b2376db031a46cfcfb742 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 11 Apr 2020 01:49:39 +0200 Subject: [Api] Check Notify (always return json) (#10059) * BEAKING: check return status based on struct not httpStatus * update Tests * CI.restart() --- routers/api/v1/notify/notifications.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'routers/api/v1') diff --git a/routers/api/v1/notify/notifications.go b/routers/api/v1/notify/notifications.go index 847fe3313e..71dd7d9492 100644 --- a/routers/api/v1/notify/notifications.go +++ b/routers/api/v1/notify/notifications.go @@ -19,15 +19,6 @@ func NewAvailable(ctx *context.APIContext) { // summary: Check if unread notifications exist // responses: // "200": - // "$ref": "#/responses/NotificationCount" - // "204": - // description: No unread notification - - count := models.CountUnread(ctx.User) - - if count > 0 { - ctx.JSON(http.StatusOK, api.NotificationCount{New: count}) - } else { - ctx.Status(http.StatusNoContent) - } + // "$ref": "#/responses/NotificationCount" + ctx.JSON(http.StatusOK, api.NotificationCount{New: models.CountUnread(ctx.User)}) } -- cgit v1.2.3