diff options
Diffstat (limited to 'server/ui/controller/history.go')
-rw-r--r-- | server/ui/controller/history.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/ui/controller/history.go b/server/ui/controller/history.go index 2c06737..e4612e1 100644 --- a/server/ui/controller/history.go +++ b/server/ui/controller/history.go @@ -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")) +} |