summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index efcb449..3d0cf16 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -1249,6 +1249,14 @@ func approveContentHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ pendID := req.FormValue("id")
+ if pendID != "" {
+ err = db.DeleteContent(req.FormValue("type")+":"+pendID, req.Form)
+ if err != nil {
+ log.Println("Failed to remove content after approval:", err)
+ }
+ }
+
// redirect to the new approved content's editor
redir := req.URL.Scheme + req.URL.Host + strings.TrimSuffix(req.URL.Path, "/approve")
redir += fmt.Sprintf("?type=%s&id=%d", t, id)