diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-09-23 21:02:26 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-09-23 21:02:26 -0700 |
commit | 9d08139f4363d3503398002bc82cb3746e3438cf (patch) | |
tree | b09c1efb14445624e4a2771bf8cbcf3a9828ecf9 /ui/entry_search.go | |
parent | 844680e57328034c20a2d2b84bd315b55fee9e23 (diff) |
Improve request package and add more unit tests
Diffstat (limited to 'ui/entry_search.go')
-rw-r--r-- | ui/entry_search.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ui/entry_search.go b/ui/entry_search.go index 15babc1..8acf103 100644 --- a/ui/entry_search.go +++ b/ui/entry_search.go @@ -25,13 +25,8 @@ func (c *Controller) ShowSearchEntry(w http.ResponseWriter, r *http.Request) { return } - entryID, err := request.IntParam(r, "entryID") - if err != nil { - html.BadRequest(w, err) - return - } - - searchQuery := request.QueryParam(r, "q", "") + entryID := request.RouteInt64Param(r, "entryID") + searchQuery := request.QueryStringParam(r, "q", "") builder := c.store.NewEntryQueryBuilder(user.ID) builder.WithSearchQuery(searchQuery) builder.WithEntryID(entryID) |