fact: remove old handler

This commit is contained in:
Chris Sexton 2019-05-27 23:15:42 -04:00
parent ab3dac35ba
commit a7712530f9
1 changed files with 0 additions and 25 deletions

View File

@ -810,28 +810,3 @@ func (p *FactoidPlugin) serveAPI(w http.ResponseWriter, r *http.Request) {
func (p *FactoidPlugin) serveQuery(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, factoidIndex)
}
func (p *FactoidPlugin) serveQueryOld(w http.ResponseWriter, r *http.Request) {
context := make(map[string]interface{})
funcMap := template.FuncMap{
// The name "title" is what the function will be called in the template text.
"linkify": linkify,
}
if e := r.FormValue("entry"); e != "" {
entries, err := getFacts(p.db, e, "")
if err != nil {
log.Error().Err(err).Msg("Web error searching")
}
context["Count"] = fmt.Sprintf("%d", len(entries))
context["Entries"] = entries
context["Search"] = e
}
t, err := template.New("factoidIndex").Funcs(funcMap).Parse(factoidIndex)
if err != nil {
log.Error().Err(err)
}
err = t.Execute(w, context)
if err != nil {
log.Error().Err(err)
}
}