diff options
Diffstat (limited to 'routers/api/v1/notify/repo.go')
-rw-r--r-- | routers/api/v1/notify/repo.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go index 1744426ee8..e87054e26c 100644 --- a/routers/api/v1/notify/repo.go +++ b/routers/api/v1/notify/repo.go @@ -110,18 +110,18 @@ func ListRepoNotifications(ctx *context.APIContext) { totalCount, err := db.Count[activities_model.Notification](ctx, opts) if err != nil { - ctx.InternalServerError(err) + ctx.APIErrorInternal(err) return } nl, err := db.Find[activities_model.Notification](ctx, opts) if err != nil { - ctx.InternalServerError(err) + ctx.APIErrorInternal(err) return } err = activities_model.NotificationList(nl).LoadAttributes(ctx) if err != nil { - ctx.InternalServerError(err) + ctx.APIErrorInternal(err) return } @@ -183,7 +183,7 @@ func ReadRepoNotifications(ctx *context.APIContext) { if len(qLastRead) > 0 { tmpLastRead, err := time.Parse(time.RFC3339, qLastRead) if err != nil { - ctx.Error(http.StatusBadRequest, "Parse", err) + ctx.APIError(http.StatusBadRequest, err) return } if !tmpLastRead.IsZero() { @@ -203,7 +203,7 @@ func ReadRepoNotifications(ctx *context.APIContext) { } nl, err := db.Find[activities_model.Notification](ctx, opts) if err != nil { - ctx.InternalServerError(err) + ctx.APIErrorInternal(err) return } @@ -217,7 +217,7 @@ func ReadRepoNotifications(ctx *context.APIContext) { for _, n := range nl { notif, err := activities_model.SetNotificationStatus(ctx, n.ID, ctx.Doer, targetStatus) if err != nil { - ctx.InternalServerError(err) + ctx.APIErrorInternal(err) return } _ = notif.LoadAttributes(ctx) |