summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-29 19:59:10 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-29 19:59:10 -0700
commitdbbadadec8ebd20c55230c14b28ae729b19bc551 (patch)
tree768cbcde28c43c084aa4767c1fbd2fd407a333f3
parent12987a604581836f669f579afede891a9fe22c1e (diff)
adding check for pending content request to update namespace in db.Content call
-rw-r--r--system/admin/handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index 2b38e16..661ede3 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -804,6 +804,8 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
q := req.URL.Query()
i := q.Get("id")
t := q.Get("type")
+ status := q.Get("status")
+
contentType, ok := content.Types[t]
if !ok {
fmt.Fprintf(res, content.ErrTypeNotRegistered, t)
@@ -812,6 +814,9 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
post := contentType()
if i != "" {
+ if status == "pending" {
+ t = t + "_pending"
+ }
data, err := db.Content(t + ":" + i)
if err != nil {
log.Println(err)