mirror of
https://github.com/miniflux/v2.git
synced 2025-09-30 19:22:11 +00:00
Improve Response to be more idiomatic
This commit is contained in:
parent
25cbd65777
commit
02ff7b4bcf
25 changed files with 302 additions and 275 deletions
|
@ -16,7 +16,7 @@ func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, r
|
|||
|
||||
args, err := c.getCommonTemplateArgs(ctx)
|
||||
if err != nil {
|
||||
response.Html().ServerError(err)
|
||||
response.HTML().ServerError(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -29,17 +29,17 @@ func (c *Controller) ShowHistoryPage(ctx *core.Context, request *core.Request, r
|
|||
|
||||
entries, err := builder.GetEntries()
|
||||
if err != nil {
|
||||
response.Html().ServerError(err)
|
||||
response.HTML().ServerError(err)
|
||||
return
|
||||
}
|
||||
|
||||
count, err := builder.CountEntries()
|
||||
if err != nil {
|
||||
response.Html().ServerError(err)
|
||||
response.HTML().ServerError(err)
|
||||
return
|
||||
}
|
||||
|
||||
response.Html().Render("history", args.Merge(tplParams{
|
||||
response.HTML().Render("history", args.Merge(tplParams{
|
||||
"entries": entries,
|
||||
"total": count,
|
||||
"pagination": c.getPagination(ctx.GetRoute("history"), count, offset),
|
||||
|
@ -53,7 +53,7 @@ func (c *Controller) FlushHistory(ctx *core.Context, request *core.Request, resp
|
|||
|
||||
err := c.store.FlushHistory(user.ID)
|
||||
if err != nil {
|
||||
response.Html().ServerError(err)
|
||||
response.HTML().ServerError(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue