Commit 4314b85a by Jose Antonio

Delete populate, not necessary

parent bd65f5cd
......@@ -60,7 +60,7 @@ module.exports = {
});
}
}).catch(function(err){
return res.serverError("Could not find active_scene");
throw new Error("Could not find active_scene, maybe there is not an active scene yet");
});
}
Scene.findOne({ id: params.id }).then(function (scene) {
......@@ -130,8 +130,7 @@ module.exports = {
getScene: function(req, res){
if (typeof req.params.id == 'undefined' || !req.params.id)
return res.badRequest("scene id not defined");
Scene.findOne({id: req.params.id})
.populate('stuPictos').then(function(scene){
Scene.findOne({id: req.params.id}).then(function(scene){
if(!scene){
return res.badRequest();
}
......
......@@ -827,7 +827,6 @@ module.exports = {
if (typeof req.params.id_stu == 'undefined' || !req.params.id_stu)
return res.badRequest("id_stu not defined");
Scene.findOne({student: req.params.id_stu, active: true})
.populate('stuPictos')
.then(function(scene){
if(!scene)
return res.badRequest("Scene not found");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment