From f0dffd39f92c64b17e0f44468757f4b199c1981b Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Wed, 13 May 2015 13:06:51 -0400 Subject: Store dateCreated on new resources --- app/node_modules/okdb/index.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/node_modules') diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js index 5aa22a2..4820c8c 100644 --- a/app/node_modules/okdb/index.js +++ b/app/node_modules/okdb/index.js @@ -68,6 +68,9 @@ FSDB.prototype.insert = function(collection, data) { data = cloneDeep(data); // Auto-increment fields data = autoincrement(wrapped, schema, data); + // Record date created + // TODO Should this meta prop logic be moved out of the DB? + data.dateCreated = new Date().toUTCString(); var result = wrapped.chain().push(data).last().value(); if (result) { -- cgit v1.2.3-70-g09d2