Commit 4314b85a by Jose Antonio

Delete populate, not necessary

parent bd65f5cd
...@@ -60,7 +60,7 @@ module.exports = { ...@@ -60,7 +60,7 @@ module.exports = {
}); });
} }
}).catch(function(err){ }).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) { Scene.findOne({ id: params.id }).then(function (scene) {
...@@ -130,8 +130,7 @@ module.exports = { ...@@ -130,8 +130,7 @@ module.exports = {
getScene: function(req, res){ getScene: function(req, res){
if (typeof req.params.id == 'undefined' || !req.params.id) if (typeof req.params.id == 'undefined' || !req.params.id)
return res.badRequest("scene id not defined"); return res.badRequest("scene id not defined");
Scene.findOne({id: req.params.id}) Scene.findOne({id: req.params.id}).then(function(scene){
.populate('stuPictos').then(function(scene){
if(!scene){ if(!scene){
return res.badRequest(); return res.badRequest();
} }
......
...@@ -827,7 +827,6 @@ module.exports = { ...@@ -827,7 +827,6 @@ module.exports = {
if (typeof req.params.id_stu == 'undefined' || !req.params.id_stu) if (typeof req.params.id_stu == 'undefined' || !req.params.id_stu)
return res.badRequest("id_stu not defined"); return res.badRequest("id_stu not defined");
Scene.findOne({student: req.params.id_stu, active: true}) Scene.findOne({student: req.params.id_stu, active: true})
.populate('stuPictos')
.then(function(scene){ .then(function(scene){
if(!scene) if(!scene)
return res.badRequest("Scene not found"); 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