summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-17 19:24:26 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-17 19:24:26 -0700
commit2a67b80c61a49b26c273a58d67c2cef9e7b549e7 (patch)
tree42c1b62637cbb4b18e86ee1d624c14e62ee338f5 /system/admin/handlers.go
parent925241488724c91394b54955c90eb78302382732 (diff)
updating handler code to support new timestamp and updated fields
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index d492335..edf351d 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -435,21 +435,18 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
cid := req.FormValue("id")
t := req.FormValue("type")
ts := req.FormValue("timestamp")
+ up := req.FormValue("updated")
// create a timestamp if one was not set
- date := make(map[string]int)
if ts == "" {
- now := time.Now()
- date["year"] = now.Year()
- date["month"] = int(now.Month())
- date["day"] = now.Day()
-
- // create timestamp format 'yyyy-mm-dd' and set in PostForm for
- // db insertion
- ts = fmt.Sprintf("%d-%02d-%02d", date["year"], date["month"], date["day"])
+ ts := fmt.Sprintf("%d", time.Now().Unix()*1000)
req.PostForm.Set("timestamp", ts)
}
+ if up == "" {
+ req.PostForm.Set("updated", ts)
+ }
+
urlPaths, err := storeFileUploads(req)
if err != nil {
fmt.Println(err)