aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/category_edit.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-11-11 11:28:29 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-11-11 11:29:12 -0800
commit5a69a61d4841a35d7ddcb761a688db8c688314d6 (patch)
treeb807ee1da5b0705e7649f70742d8198f351c1224 /ui/category_edit.go
parent0925899cee9362cf09e982487bd480e2b09041f4 (diff)
Move UI middlewares and routes to ui package
Diffstat (limited to 'ui/category_edit.go')
-rw-r--r--ui/category_edit.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/ui/category_edit.go b/ui/category_edit.go
index e0375be..344cfe4 100644
--- a/ui/category_edit.go
+++ b/ui/category_edit.go
@@ -14,19 +14,18 @@ import (
"miniflux.app/ui/view"
)
-// EditCategory shows the form to modify a category.
-func (c *Controller) EditCategory(w http.ResponseWriter, r *http.Request) {
- sess := session.New(c.store, request.SessionID(r))
- view := view.New(c.tpl, r, sess)
+func (h *handler) showEditCategoryPage(w http.ResponseWriter, r *http.Request) {
+ sess := session.New(h.store, request.SessionID(r))
+ view := view.New(h.tpl, r, sess)
- user, err := c.store.UserByID(request.UserID(r))
+ user, err := h.store.UserByID(request.UserID(r))
if err != nil {
html.ServerError(w, r, err)
return
}
categoryID := request.RouteInt64Param(r, "categoryID")
- category, err := c.store.Category(request.UserID(r), categoryID)
+ category, err := h.store.Category(request.UserID(r), categoryID)
if err != nil {
html.ServerError(w, r, err)
return
@@ -45,8 +44,8 @@ func (c *Controller) EditCategory(w http.ResponseWriter, r *http.Request) {
view.Set("category", category)
view.Set("menu", "categories")
view.Set("user", user)
- view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
- view.Set("countErrorFeeds", c.store.CountErrorFeeds(user.ID))
+ view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
+ view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
html.OK(w, r, view.Render("edit_category"))
}