diff --git a/README.md b/README.md index 256ad97..ac32813 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ frontend app code: https://github.com/idoctnef/collectivecarApp -comment publication(car, travel, package) --> done -valorating users system +-passed dates not shown from server +-don't allow to add travels with passed date + -GUI admin page -UX design diff --git a/config.js b/config.js index d0108f3..7b004bc 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ module.exports = { - /*'secret': process.env.SECRET,// production version - 'database': process.env.MONGO_DSN,*/ - 'secret': 'secretfortoken',// local version - 'database': 'mongodb://localhost/comunalcar', + 'secret': process.env.SECRET,// production version + 'database': process.env.MONGO_DSN, + /*'secret': 'secretfortoken',// local version + 'database': 'mongodb://localhost/comunalcar',*/ "port" : process.env.PORT || 3000 }; diff --git a/controllers/travelController.js b/controllers/travelController.js index 7eb6df5..e215822 100644 --- a/controllers/travelController.js +++ b/controllers/travelController.js @@ -71,8 +71,14 @@ exports.addTravel = function(req, res) { travel.save(function(err, travel) { if(err) return res.send(500, err.message); - res.status(200).jsonp(travel); + //res.status(200).jsonp(travel); + travelModel.find(function(err, travels) { + if(err) res.send(500, err.message); + + res.status(200).jsonp(travels); + }); }); + }; //PUT @@ -119,7 +125,11 @@ exports.addJoin = function(req, res) { travel.save(function(err, travel) { if(err) return res.send(500, err.message); - res.status(200).jsonp(travel); + //res.status(200).jsonp(travel); + travelModel.find(function(err, travels) { + if(err) res.send(500, err.message); + res.status(200).jsonp(travels); + }); }); }); }; @@ -152,7 +162,11 @@ exports.doUnjoin = function(req, res) { travel.save(function(err, travel) { if(err) return res.send(500, err.message); - res.status(200).jsonp(travel); + //res.status(200).jsonp(travel); + travelModel.find(function(err, travels) { + if(err) res.send(500, err.message); + res.status(200).jsonp(travels); + }); }); }); };