From 1d924c30824d3cf4580cb584605e4d5205f910c4 Mon Sep 17 00:00:00 2001 From: idoctnef Date: Mon, 19 Sep 2016 10:58:07 +0200 Subject: [PATCH] unjoin implemented --- README.md | 12 ++++++------ controllers/travelController.js | 19 +++++++++++++++++++ server.js | 3 +++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 00823f3..e2083f2 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,19 @@ frontend app code: https://github.com/idoctnef/collectivecarApp -delete travel --> done -create offeringCar --> done -update offeringCar --delete offeringCar +-delete offeringCar --> done -create askingForTravel (needtravel) --> done -update askingForTravel --delete askgingForTravel +-delete askgingForTravel --> done -create askingPackage (need transport package) --> done -update askingPackage --delete askgingPackage +-delete askgingPackage --> done -user joins a car --> done -user offer car to a travel --> done -user offer car to a askingpackage --> done --user unjoins a car --user unoffer car to a travel --user unoffer car to a askingpackage +-user unjoins a car --> done +-user unoffer car to a travel --> done +-user unoffer car to a askingpackage --> done -comment publication(car, travel, package) --> done -valorating users system diff --git a/controllers/travelController.js b/controllers/travelController.js index 8d803eb..4a264bd 100644 --- a/controllers/travelController.js +++ b/controllers/travelController.js @@ -121,6 +121,25 @@ exports.addJoin = function(req, res) { }); }; +exports.doUnjoin = function(req, res) { + joinModel.find({ + travelId: req.params.travelId + }, function(err, joins) { + for(var i=0; i