Browse Source

getallevents except alerts

master
arnaucode 7 years ago
parent
commit
e04d1c6fce
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      controllers/eventController.js
  2. +1
    -1
      server.js

+ 2
- 1
controllers/eventController.js

@ -11,7 +11,8 @@ var pageSize=config.pageSize;
exports.getAllEvents = function(req, res) { exports.getAllEvents = function(req, res) {
eventModel.find({ eventModel.find({
date: {$gte: new Date()}//cal filtrar per type d'event, de si es alert o no
date: {$gte: new Date()},
type: {$nin: ["alert"]}//cal filtrar per type d'event, aquí només agafem els type: alert
}) })
.lean() .lean()
.populate('user', 'username img shortDescription') .populate('user', 'username img shortDescription')

+ 1
- 1
server.js

@ -32,7 +32,7 @@ var userMdl = require('./models/userModel')(app, mongoose);
var userCtrl = require('./controllers/userController'); var userCtrl = require('./controllers/userController');
var eventMdl = require('./models/eventModel')(app, mongoose); var eventMdl = require('./models/eventModel')(app, mongoose);
var eventCtrl = require('./controllers/eventController'); var eventCtrl = require('./controllers/eventController');
var alertMdl = require('./models/alertModel')(app, mongoose);
//var alertMdl = require('./models/alertModel')(app, mongoose);
//var alertCtrl = require('./controllers/alertController'); //var alertCtrl = require('./controllers/alertController');
//CORS //CORS

Loading…
Cancel
Save