From 5a69a61d4841a35d7ddcb761a688db8c688314d6 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 11 Nov 2018 11:28:29 -0800 Subject: Move UI middlewares and routes to ui package --- ui/category_edit.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'ui/category_edit.go') 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")) } -- cgit v1.2.3