From 91a59fa5ad68bac95e8c5c0bb6519d9a68adf588 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 16 Mar 2016 14:20:16 -0400 Subject: [PATCH] add createdAt/updatedAt dates --- lib/dbwrap.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dbwrap.js b/lib/dbwrap.js index ce70d8a..cc67861 100644 --- a/lib/dbwrap.js +++ b/lib/dbwrap.js @@ -327,8 +327,8 @@ function wrap(db, dir, dbsMap) { return PromiseA.reject(new Error("no id supplied")); } - obj.created_at = Date.now(); - obj.updated_at = Date.now(); + obj.createdAt = Date.now(); + obj.updatedAt = Date.now(); return new PromiseA(function (resolve, reject) { var json = JSON.stringify(obj); @@ -441,6 +441,8 @@ function wrap(db, dir, dbsMap) { } DB.set = function (id, obj) { + obj.updatedAt = Date.now(); + var json = JSON.stringify(obj); var data = JSON.parse(json);