swap out timestamp before pushing into the database

This commit is contained in:
Paul Trowbridge 2019-03-22 14:39:16 -04:00
parent 429baa0c04
commit 1f9623e026

View File

@ -185,6 +185,7 @@ server.post('/addmonth_v', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("-----------------------------add month volume:---------------------------------"); console.log("-----------------------------add month volume:---------------------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("scenario = target_scenario",'g'),w); sql = sql.replace(new RegExp("scenario = target_scenario",'g'),w);
@ -217,6 +218,7 @@ server.post('/addmonth_vp', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("------------------add month volume and price:-------------------"); console.log("------------------add month volume and price:-------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);
@ -259,6 +261,7 @@ server.post('/scale_v', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("-----------------------scale volume:------------------------------"); console.log("-----------------------scale volume:------------------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);
@ -299,6 +302,7 @@ server.post('/scale_p', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("--------------------scale price:-------------------"); console.log("--------------------scale price:-------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);
@ -339,6 +343,7 @@ server.post('/scale_vp', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("--------------------scale volume & price:-------------------"); console.log("--------------------scale volume & price:-------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);
@ -380,6 +385,7 @@ server.post('/new_part', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("--------------------new part:-------------------"); console.log("--------------------new part:-------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);
@ -422,6 +428,7 @@ server.post('/new_basket', bodyParser.json(), function (req, res) {
return; return;
} }
console.log("--------------------new basket:-------------------"); console.log("--------------------new basket:-------------------");
req.body.stamp = new Date().toISOString()
console.log(req.body); console.log(req.body);
//console.log(args); //console.log(args);
sql = sql.replace(new RegExp("where_clause",'g'),w); sql = sql.replace(new RegExp("where_clause",'g'),w);