Updates to the data tracking app; Updated the VAP list.
This commit is contained in:
@@ -3,7 +3,7 @@ var fs = require('fs');
|
||||
var path = require('path');
|
||||
var adminPath;
|
||||
|
||||
var PRODUCT_LIST_PATH = "VAP_Availability_List_Oct2016.pdf";
|
||||
var PRODUCT_LIST_PATH = "VAP_Availability_List_Nov2016.pdf";
|
||||
|
||||
//Notes:
|
||||
//Use res.send or res.sendFile for static resources (like images or html)
|
||||
@@ -222,9 +222,9 @@ module.exports = function(app, rootPath, passport, smtpTransport, sequelize) {
|
||||
//TODO: Can we just use extend?
|
||||
Object.keys(req.body).forEach(function(key) {params[key] = req.body[key]});
|
||||
|
||||
// if(params.msgpack) {
|
||||
// params = msgpack.decode(params.msgpack);
|
||||
// }
|
||||
//The client must wrapper any JSON it wants to send into another JSON object whose sole attribute is 'request' and whose value is the actual parameter JSON stringified.
|
||||
//This is because for some unknown reason, jquery.ajax (or derivative methods) does not stringify the JSON correctly (converts bool, int, etc, into strings), and the server cannot convert the strings back into native types.
|
||||
params = params.request ? JSON.parse(params.request) : params;
|
||||
|
||||
if(!model) {
|
||||
res.status(400).end();
|
||||
@@ -325,10 +325,11 @@ module.exports = function(app, rootPath, passport, smtpTransport, sequelize) {
|
||||
break;
|
||||
}
|
||||
case 'restore': {
|
||||
params.paranoid = false;
|
||||
model.find(params).then(function(value) {
|
||||
if(value) {
|
||||
value.deletedAt = null;
|
||||
value.save().then(function() {
|
||||
value.setDataValue('deletedAt', null);
|
||||
value.save({paranoid: false}).then(function() {
|
||||
res.status(200).end();
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
@@ -378,7 +379,10 @@ module.exports = function(app, rootPath, passport, smtpTransport, sequelize) {
|
||||
res.status(400).end();
|
||||
}
|
||||
}
|
||||
catch(e) {console.log(e); res.status(400).end();}
|
||||
catch(e) {
|
||||
console.log(e);
|
||||
res.status(400).end();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user