From 4dade55387515e3ed153a5901672abdfb7f3654f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sun, 14 Apr 2019 20:29:18 +0200 Subject: sklad: implement search --- sklad/main.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sklad/main.go') diff --git a/sklad/main.go b/sklad/main.go index 1a9442a..9df1fd5 100644 --- a/sklad/main.go +++ b/sklad/main.go @@ -157,12 +157,15 @@ func handleSearch(w http.ResponseWriter, r *http.Request) { } query := r.FormValue("q") - _ = query - - // TODO: Query the database for exact matches and fulltext. - // - Will want to show the full path from the root "" container. - - params := struct{}{} + params := struct { + Query string + Series []*Series + Containers []*Container + }{ + Query: query, + Series: dbSearchSeries(query), + Containers: dbSearchContainers(query), + } executeTemplate("search.tmpl", w, ¶ms) } -- cgit v1.2.3