From cc3016f70d818370b94e7c2391e96470114fb34c Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 3 May 2022 21:38:34 +0000 Subject: [PATCH] Use correct context in `routers/web` (#19597) - Don't use the `APIContext` in the web routers. --- routers/web/user/notification.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index f7848de90a..05421cf555 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -15,7 +15,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" - api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/structs" ) const ( @@ -194,6 +194,6 @@ func NotificationPurgePost(c *context.Context) { } // NewAvailable returns the notification counts -func NewAvailable(ctx *context.APIContext) { - ctx.JSON(http.StatusOK, api.NotificationCount{New: models.CountUnread(ctx.Doer)}) +func NewAvailable(ctx *context.Context) { + ctx.JSON(http.StatusOK, structs.NotificationCount{New: models.CountUnread(ctx.Doer)}) }