Add list of compiled regexps to /rest/ignores (fixes #942)

This commit is contained in:
Jakob Borg
2014-11-08 22:12:18 +01:00
parent ae0e56e98d
commit 2449723a1c
3 changed files with 27 additions and 7 deletions

View File

@@ -476,13 +476,15 @@ func restGetIgnores(m *model.Model, w http.ResponseWriter, r *http.Request) {
qs := r.URL.Query()
w.Header().Set("Content-Type", "application/json; charset=utf-8")
ignores, err := m.GetIgnores(qs.Get("folder"))
ignores, patterns, err := m.GetIgnores(qs.Get("folder"))
if err != nil {
http.Error(w, err.Error(), 500)
return
}
json.NewEncoder(w).Encode(map[string][]string{
"ignore": ignores,
"ignore": ignores,
"patterns": patterns,
})
}