diff options
Diffstat (limited to 'routers/api/v1/notify/user.go')
-rw-r--r-- | routers/api/v1/notify/user.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/api/v1/notify/user.go b/routers/api/v1/notify/user.go index c2178b4dee..e4626cb719 100644 --- a/routers/api/v1/notify/user.go +++ b/routers/api/v1/notify/user.go @@ -68,6 +68,12 @@ func ListNotifications(ctx *context.APIContext) { return } + totalCount, err := models.CountNotifications(opts) + if err != nil { + ctx.InternalServerError(err) + return + } + nl, err := models.GetNotifications(opts) if err != nil { ctx.InternalServerError(err) @@ -79,6 +85,7 @@ func ListNotifications(ctx *context.APIContext) { return } + ctx.SetTotalCountHeader(totalCount) ctx.JSON(http.StatusOK, convert.ToNotifications(nl)) } |