bugfix search
This commit is contained in:
parent
444b0cd24a
commit
3dbe12b562
|
@ -54,8 +54,9 @@ func (h searchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func seachMap[T model.Named](s string, input map[int]T, output []SearchResult, baseUrl string) []SearchResult {
|
func seachMap[T model.Named](s string, input map[int]T, output []SearchResult, baseUrl string) []SearchResult {
|
||||||
|
s = strings.ToLower(s)
|
||||||
for id, v := range input {
|
for id, v := range input {
|
||||||
if strings.Contains(v.Name(), s) {
|
if strings.Contains(strings.ToLower(v.Name()), s) {
|
||||||
output = append(output, SearchResult{
|
output = append(output, SearchResult{
|
||||||
Label: util.Title(v.Name()),
|
Label: util.Title(v.Name()),
|
||||||
Value: fmt.Sprintf("%s/%d", baseUrl, id),
|
Value: fmt.Sprintf("%s/%d", baseUrl, id),
|
||||||
|
|
Loading…
Reference in New Issue