mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-13 09:55:36 +00:00
search items
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user