diff options
author | Přemysl Janouch <p@janouch.name> | 2019-04-14 20:29:18 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2019-04-14 20:29:18 +0200 |
commit | 4dade55387515e3ed153a5901672abdfb7f3654f (patch) | |
tree | 6c1e30193745adfcea111b791b1ae7dd884b3b9f /sklad/main.go | |
parent | 3d98454543f4494fd267e851b48d58a05aea11dc (diff) | |
download | sklad-4dade55387515e3ed153a5901672abdfb7f3654f.tar.gz sklad-4dade55387515e3ed153a5901672abdfb7f3654f.tar.xz sklad-4dade55387515e3ed153a5901672abdfb7f3654f.zip |
sklad: implement search
Diffstat (limited to 'sklad/main.go')
-rw-r--r-- | sklad/main.go | 15 |
1 files changed, 9 insertions, 6 deletions
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) } |