diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-18 14:12:01 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-18 14:12:01 -0700 |
commit | 9ffc6f115deef547ae07a0837ef2cd1a70a5dd0f (patch) | |
tree | c5e429f17f60b6399b7f1383660eb7a767453916 | |
parent | b73b8b065ca85fda4500eb0a4eeba9a0c6e71292 (diff) |
updating call location of StoreContent to be centralized to db actions, rather than inside http handlers
-rw-r--r-- | system/admin/handlers.go | 2 | ||||
-rw-r--r-- | system/db/content.go | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 17a4843..edf351d 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -498,8 +498,6 @@ func editHandler(res http.ResponseWriter, req *http.Request) { return } - go db.SortContent(t) - scheme := req.URL.Scheme host := req.URL.Host path := req.URL.Path diff --git a/system/db/content.go b/system/db/content.go index 890c7d6..caa2af3 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -65,6 +65,8 @@ func update(ns, id string, data url.Values) (int, error) { return 0, nil } + go SortContent(ns) + return cid, nil } @@ -105,6 +107,8 @@ func insert(ns string, data url.Values) (int, error) { return 0, err } + go SortContent(ns) + return effectedID, nil } @@ -154,6 +158,8 @@ func DeleteContent(target string) error { return err } + go SortContent(ns) + return nil } |