From 1f9623e0265b0530d3efd83841cc5246d27aded0 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 22 Mar 2019 14:39:16 -0400 Subject: [PATCH] swap out timestamp before pushing into the database --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 3e71223..4684155 100644 --- a/index.js +++ b/index.js @@ -185,6 +185,7 @@ server.post('/addmonth_v', bodyParser.json(), function (req, res) { return; } console.log("-----------------------------add month volume:---------------------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("scenario = target_scenario",'g'),w); @@ -217,6 +218,7 @@ server.post('/addmonth_vp', bodyParser.json(), function (req, res) { return; } console.log("------------------add month volume and price:-------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w); @@ -259,6 +261,7 @@ server.post('/scale_v', bodyParser.json(), function (req, res) { return; } console.log("-----------------------scale volume:------------------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w); @@ -299,6 +302,7 @@ server.post('/scale_p', bodyParser.json(), function (req, res) { return; } console.log("--------------------scale price:-------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w); @@ -339,6 +343,7 @@ server.post('/scale_vp', bodyParser.json(), function (req, res) { return; } console.log("--------------------scale volume & price:-------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w); @@ -380,6 +385,7 @@ server.post('/new_part', bodyParser.json(), function (req, res) { return; } console.log("--------------------new part:-------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w); @@ -422,6 +428,7 @@ server.post('/new_basket', bodyParser.json(), function (req, res) { return; } console.log("--------------------new basket:-------------------"); + req.body.stamp = new Date().toISOString() console.log(req.body); //console.log(args); sql = sql.replace(new RegExp("where_clause",'g'),w);