search items
This commit is contained in:
parent
3c4d48fdc7
commit
5d5f95725f
4 changed files with 32 additions and 6 deletions
|
|
@ -308,6 +308,9 @@ func ItemListHandler(rw http.ResponseWriter, req *http.Request) {
|
|||
statusValue := storage.StatusValues[status]
|
||||
filter.Status = &statusValue
|
||||
}
|
||||
if search := query.Get("search"); len(search) != 0 {
|
||||
filter.Search = &search
|
||||
}
|
||||
items := db(req).ListItems(filter, (curPage-1)*perPage, perPage)
|
||||
count := db(req).CountItems(filter)
|
||||
rw.WriteHeader(http.StatusOK)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue