Commit 6853e6da by Jose Antonio

GetScene fix active scene

parent eabf6c9a
Showing with 8 additions and 3 deletions
......@@ -110,12 +110,17 @@ module.exports = {
return res.badRequest();
}
else{
Scene.pictos(scene.id, function(err, pictos){
Student.findOne({id:scene.student}).then(student=>{
Scene.pictos(scene.id, function(err, pictos){
if (err){
return res.serverError("Error obtaining pictos: "+ err);
}
scene.pictos=pictos;
return res.ok(scene);
scene.active = scene.id == student.id_active_scene;
scene.pictos=pictos;
return res.ok(scene);
});
}).catch(function(err){
});
}
}).catch(function (err){
......
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