diff options
Diffstat (limited to 'routers/api/v1/notify/user.go')
-rw-r--r-- | routers/api/v1/notify/user.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/api/v1/notify/user.go b/routers/api/v1/notify/user.go index b923307783..1b6706e16f 100644 --- a/routers/api/v1/notify/user.go +++ b/routers/api/v1/notify/user.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "code.gitea.io/gitea/models" + activities_model "code.gitea.io/gitea/models/activities" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" "code.gitea.io/gitea/modules/structs" @@ -69,13 +69,13 @@ func ListNotifications(ctx *context.APIContext) { return } - totalCount, err := models.CountNotifications(opts) + totalCount, err := activities_model.CountNotifications(opts) if err != nil { ctx.InternalServerError(err) return } - nl, err := models.GetNotifications(ctx, opts) + nl, err := activities_model.GetNotifications(ctx, opts) if err != nil { ctx.InternalServerError(err) return @@ -140,7 +140,7 @@ func ReadNotifications(ctx *context.APIContext) { lastRead = tmpLastRead.Unix() } } - opts := &models.FindNotificationOptions{ + opts := &activities_model.FindNotificationOptions{ UserID: ctx.Doer.ID, UpdatedBeforeUnix: lastRead, } @@ -148,7 +148,7 @@ func ReadNotifications(ctx *context.APIContext) { statuses := ctx.FormStrings("status-types") opts.Status = statusStringsToNotificationStatuses(statuses, []string{"unread"}) } - nl, err := models.GetNotifications(ctx, opts) + nl, err := activities_model.GetNotifications(ctx, opts) if err != nil { ctx.InternalServerError(err) return @@ -156,13 +156,13 @@ func ReadNotifications(ctx *context.APIContext) { targetStatus := statusStringToNotificationStatus(ctx.FormString("to-status")) if targetStatus == 0 { - targetStatus = models.NotificationStatusRead + targetStatus = activities_model.NotificationStatusRead } changed := make([]*structs.NotificationThread, 0, len(nl)) for _, n := range nl { - notif, err := models.SetNotificationStatus(n.ID, ctx.Doer, targetStatus) + notif, err := activities_model.SetNotificationStatus(n.ID, ctx.Doer, targetStatus) if err != nil { ctx.InternalServerError(err) return |