From af3f7ada295115808c2407e1576ec703091c6c0a Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 2 Jan 2017 13:54:28 -0800 Subject: more code cleanup and adding content dir empty on build before copy --- system/admin/handlers.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'system/admin/handlers.go') 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) -- cgit v1.2.3