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

Add flush history feature

This commit is contained in:
Frédéric Guillot 2017-11-21 15:46:59 -08:00
parent 238b9e4c85
commit 549a4277b0
15 changed files with 79 additions and 17 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/miniflux/miniflux2/server/core"
)
// ShowHistoryPage renders the page with all read entries.
func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, response *core.Response) {
user := ctx.GetLoggedUser()
offset := request.GetQueryIntegerParam("offset", 0)
@ -45,3 +46,16 @@ func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, r
"menu": "history",
}))
}
// FlushHistory changes all "read" items to "removed".
func (c *Controller) FlushHistory(ctx *core.Context, request *core.Request, response *core.Response) {
user := ctx.GetLoggedUser()
err := c.store.FlushHistory(user.ID)
if err != nil {
response.Html().ServerError(err)
return
}
response.Redirect(ctx.GetRoute("history"))
}