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) {
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()
.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 eventMdl = require('./models/eventModel')(app, mongoose);
var eventCtrl = require('./controllers/eventController');
var alertMdl = require('./models/alertModel')(app, mongoose);
//var alertMdl = require('./models/alertModel')(app, mongoose);
//var alertCtrl = require('./controllers/alertController');
//CORS

Loading…
Cancel
Save