From 9d08139f4363d3503398002bc82cb3746e3438cf Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 23 Sep 2018 21:02:26 -0700 Subject: Improve request package and add more unit tests --- ui/entry_category.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'ui/entry_category.go') diff --git a/ui/entry_category.go b/ui/entry_category.go index 795aaf1..283f015 100644 --- a/ui/entry_category.go +++ b/ui/entry_category.go @@ -25,17 +25,8 @@ func (c *Controller) ShowCategoryEntry(w http.ResponseWriter, r *http.Request) { return } - categoryID, err := request.IntParam(r, "categoryID") - if err != nil { - html.BadRequest(w, err) - return - } - - entryID, err := request.IntParam(r, "entryID") - if err != nil { - html.BadRequest(w, err) - return - } + categoryID := request.RouteInt64Param(r, "categoryID") + entryID := request.RouteInt64Param(r, "entryID") builder := c.store.NewEntryQueryBuilder(user.ID) builder.WithCategoryID(categoryID) -- cgit v1.2.3