1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add link to mark everything as read

This commit is contained in:
Frédéric Guillot 2018-01-04 18:11:15 -08:00
parent efac11e082
commit c57cafbef2
7 changed files with 39 additions and 6 deletions

View file

@ -6,6 +6,7 @@ package ui
import (
"github.com/miniflux/miniflux/http/handler"
"github.com/miniflux/miniflux/logger"
"github.com/miniflux/miniflux/model"
)
@ -47,3 +48,12 @@ func (c *Controller) ShowUnreadPage(ctx *handler.Context, request *handler.Reque
"csrf": ctx.CSRF(),
})
}
// MarkAllAsRead marks all unread entries as read.
func (c *Controller) MarkAllAsRead(ctx *handler.Context, request *handler.Request, response *handler.Response) {
if err := c.store.MarkAllAsRead(ctx.UserID()); err != nil {
logger.Error("[MarkAllAsRead] %v", err)
}
response.Redirect(ctx.Route("unread"))
}