diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-02 13:54:28 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-02 13:54:28 -0800 |
commit | af3f7ada295115808c2407e1576ec703091c6c0a (patch) | |
tree | fc8dcb556d4a61bc44665895f0a01ff8f8d1460e /system/admin/handlers.go | |
parent | ae201cf1af12132ed5aed3c180bcb785dee85621 (diff) |
more code cleanup and adding content dir empty on build before copy
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r-- | system/admin/handlers.go | 8 |
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) |