0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 12:45:08 +01:00

Use correct context in routers/web (#19597)

- Don't use the `APIContext` in the web routers.
This commit is contained in:
Gusted 2022-05-03 21:38:34 +00:00 committed by GitHub
parent 92f139d091
commit cc3016f70d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)})
}