diff options
Diffstat (limited to 'routers/api/v1/notify/threads.go')
-rw-r--r-- | routers/api/v1/notify/threads.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/api/v1/notify/threads.go b/routers/api/v1/notify/threads.go index 1774c0b412..2e241080b4 100644 --- a/routers/api/v1/notify/threads.go +++ b/routers/api/v1/notify/threads.go @@ -71,7 +71,7 @@ func ReadThread(ctx *context.APIContext) { // required: false // responses: // "205": - // "$ref": "#/responses/empty" + // "$ref": "#/responses/NotificationThread" // "403": // "$ref": "#/responses/forbidden" // "404": @@ -87,12 +87,16 @@ func ReadThread(ctx *context.APIContext) { targetStatus = models.NotificationStatusRead } - err := models.SetNotificationStatus(n.ID, ctx.User, targetStatus) + notif, err := models.SetNotificationStatus(n.ID, ctx.User, targetStatus) if err != nil { ctx.InternalServerError(err) return } - ctx.Status(http.StatusResetContent) + if err = notif.LoadAttributes(); err != nil { + ctx.InternalServerError(err) + return + } + ctx.JSON(http.StatusResetContent, convert.ToNotificationThread(notif)) } func getThread(ctx *context.APIContext) *models.Notification { |