From a7712530f93fb4cb4a6f11f86de5fa8353364673 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 27 May 2019 23:15:42 -0400 Subject: [PATCH] fact: remove old handler --- plugins/fact/factoid.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/plugins/fact/factoid.go b/plugins/fact/factoid.go index 6546c7e..452fcc0 100644 --- a/plugins/fact/factoid.go +++ b/plugins/fact/factoid.go @@ -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) - } -}