|
@ -61,11 +61,11 @@ apiRoutes.route('/signup') |
|
|
.post(userCtrl.signup); |
|
|
.post(userCtrl.signup); |
|
|
apiRoutes.route('/users') |
|
|
apiRoutes.route('/users') |
|
|
.get(userCtrl.getAllUsers); |
|
|
.get(userCtrl.getAllUsers); |
|
|
apiRoutes.route('/users/getByUserId/:userid') |
|
|
|
|
|
|
|
|
apiRoutes.route('/users/id/:userid') |
|
|
.get(userCtrl.getUserById); |
|
|
.get(userCtrl.getUserById); |
|
|
apiRoutes.route('/travels') |
|
|
apiRoutes.route('/travels') |
|
|
.get(travelCtrl.getAllTravels); |
|
|
.get(travelCtrl.getAllTravels); |
|
|
apiRoutes.route('/travels/getByTravelId/:travelid') |
|
|
|
|
|
|
|
|
apiRoutes.route('/travels/id/:travelid') |
|
|
.get(travelCtrl.getTravelById); |
|
|
.get(travelCtrl.getTravelById); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -107,21 +107,21 @@ apiRoutes.use(function(req, res, next) { |
|
|
}); //fi verificació de token
|
|
|
}); //fi verificació de token
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apiRoutes.route('/users/getByToken') |
|
|
|
|
|
|
|
|
apiRoutes.route('/users/token') |
|
|
.get(userCtrl.getUserByToken); |
|
|
.get(userCtrl.getUserByToken); |
|
|
apiRoutes.route('/users')//agafa l'user a partir del token
|
|
|
apiRoutes.route('/users')//agafa l'user a partir del token
|
|
|
.put(userCtrl.updateUser)//no comprovat
|
|
|
.put(userCtrl.updateUser)//no comprovat
|
|
|
.delete(userCtrl.deleteUser); |
|
|
.delete(userCtrl.deleteUser); |
|
|
apiRoutes.route('/travels') |
|
|
apiRoutes.route('/travels') |
|
|
.post(travelCtrl.addTravel); |
|
|
.post(travelCtrl.addTravel); |
|
|
apiRoutes.route('/travels/modifyById/:travelid') |
|
|
|
|
|
|
|
|
apiRoutes.route('/travels/id/modify/:travelid') |
|
|
.put(travelCtrl.updateTravel)//no comprovat
|
|
|
.put(travelCtrl.updateTravel)//no comprovat
|
|
|
.delete(travelCtrl.deleteTravel); |
|
|
.delete(travelCtrl.deleteTravel); |
|
|
apiRoutes.route('/travels/join/:travelid') |
|
|
apiRoutes.route('/travels/join/:travelid') |
|
|
.get(travelCtrl.addJoinPetition); |
|
|
.get(travelCtrl.addJoinPetition); |
|
|
apiRoutes.route('/travels/unjoin/:travelid') |
|
|
apiRoutes.route('/travels/unjoin/:travelid') |
|
|
.get(travelCtrl.unJoin); |
|
|
.get(travelCtrl.unJoin); |
|
|
apiRoutes.route('/travels/getByUserId/:userid') |
|
|
|
|
|
|
|
|
apiRoutes.route('/travels/byuser/id/:userid') |
|
|
.get(travelCtrl.getTravelsByUserId); |
|
|
.get(travelCtrl.getTravelsByUserId); |
|
|
//FINS AQUÏ COMPROVAT
|
|
|
//FINS AQUÏ COMPROVAT
|
|
|
|
|
|
|
|
|