mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-07 18:30:26 +00:00
Add lock and status to the search handlers
This commit is contained in:
parent
901494a70e
commit
551876dd32
@ -23,6 +23,10 @@ func handlerTitleSearch(w http.ResponseWriter, rq *http.Request) {
|
|||||||
query = rq.FormValue("q")
|
query = rq.FormValue("q")
|
||||||
u = user.FromRequest(rq)
|
u = user.FromRequest(rq)
|
||||||
)
|
)
|
||||||
|
if shown := u.ShowLockMaybe(w, rq); shown {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = io.WriteString(
|
_, _ = io.WriteString(
|
||||||
w,
|
w,
|
||||||
views.BaseHTML(
|
views.BaseHTML(
|
||||||
@ -38,7 +42,12 @@ func handlerTitleSearchJSON(w http.ResponseWriter, rq *http.Request) {
|
|||||||
_ = rq.ParseForm()
|
_ = rq.ParseForm()
|
||||||
var (
|
var (
|
||||||
query = rq.FormValue("q")
|
query = rq.FormValue("q")
|
||||||
|
u = user.FromRequest(rq)
|
||||||
)
|
)
|
||||||
|
if shown := u.ShowLockMaybe(w, rq); shown {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = io.WriteString(
|
_, _ = io.WriteString(
|
||||||
w,
|
w,
|
||||||
views.TitleSearchJSON(query, shroom.YieldHyphaNamesContainingString),
|
views.TitleSearchJSON(query, shroom.YieldHyphaNamesContainingString),
|
||||||
|
Loading…
Reference in New Issue
Block a user