arnaucube
arnaucube/openEventsPlatformServerPublic Self-hosted repository
fixed getEventsByFollowingArray
arnaucode idoctnef@openmailbox.org
Sat, 25 Feb 2017 12:59:02 +0100
commit

908233e842bec3a256d76e59e7780de5192725e0

parent

3480b90a7ac87abd5c9f997a69f1a14740cce7f6

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M controllers/eventController.js → controllers/eventController.js

@@ -175,9 +175,14 @@ això retorna els events d'aquests users que segueixes

*/ exports.getEventsByFollowingArray = function(req, res) { + if(req.body.users==null) + { + res.status(200).jsonp(null); + } eventModel.find({ date: {$gte: new Date()}, - 'username': req.body.users + 'user': req.body.users, + type: {$nin: ["alert"]}//cal filtrar per type d'event, aquí només agafem els type: alert }) .lean() .populate('user', 'username img shortDescription')