summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
authorTom Fawssett <tom.fawssett@gmail.com>2017-06-24 16:01:41 +0100
committerTom Fawssett <tom.fawssett@gmail.com>2017-06-24 16:01:41 +0100
commit0a1d7d9cd8ad1ac01c8fcd4d3b4fef57cffd4cb0 (patch)
tree8b7df0eddd9493426d5830d428775ff8599cb18b /system/admin/handlers.go
parent30dea40a20e45bdb0d32fd7c373f07e1dccbe794 (diff)
Add Backup function to search
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index 3933d3d..aac9ec2 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -23,6 +23,7 @@ import (
"github.com/ponzu-cms/ponzu/system/api/analytics"
"github.com/ponzu-cms/ponzu/system/db"
"github.com/ponzu-cms/ponzu/system/item"
+ "github.com/ponzu-cms/ponzu/system/search"
"github.com/gorilla/schema"
emailer "github.com/nilslice/email"
@@ -224,6 +225,14 @@ func backupHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ case "search":
+ err := search.Backup(ctx, res)
+ if err != nil {
+ log.Println("Failed to run backup on search:", err)
+ res.WriteHeader(http.StatusInternalServerError)
+ return
+ }
+
default:
res.WriteHeader(http.StatusBadRequest)
}