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