Skip to content

Commit 28a39d9

Browse files
GustedAbdulrhmnGhanem
authored andcommitted
Use correct context in routers/web (go-gitea#19597)
- Don't use the `APIContext` in the web routers.
1 parent 637429f commit 28a39d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/web/user/notification.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"code.gitea.io/gitea/modules/base"
1616
"code.gitea.io/gitea/modules/context"
1717
"code.gitea.io/gitea/modules/setting"
18-
api "code.gitea.io/gitea/modules/structs"
18+
"code.gitea.io/gitea/modules/structs"
1919
)
2020

2121
const (
@@ -194,6 +194,6 @@ func NotificationPurgePost(c *context.Context) {
194194
}
195195

196196
// NewAvailable returns the notification counts
197-
func NewAvailable(ctx *context.APIContext) {
198-
ctx.JSON(http.StatusOK, api.NotificationCount{New: models.CountUnread(ctx.Doer)})
197+
func NewAvailable(ctx *context.Context) {
198+
ctx.JSON(http.StatusOK, structs.NotificationCount{New: models.CountUnread(ctx.Doer)})
199199
}

0 commit comments

Comments
 (0)