populate student license working with websocket

parent 62e60852
...@@ -950,6 +950,9 @@ module.exports = { ...@@ -950,6 +950,9 @@ module.exports = {
return res.serverError("Error updating active scene"); return res.serverError("Error updating active scene");
} }
else{ else{
Student.findOne({id:params.id_stu})
.populate('license')
.then(student => {
// Send websocket message // Send websocket message
sails.hooks.events.broadcastEvent( sails.hooks.events.broadcastEvent(
sails.hooks.rooms.student(student.id), sails.hooks.rooms.student(student.id),
...@@ -957,6 +960,7 @@ module.exports = { ...@@ -957,6 +960,7 @@ module.exports = {
(req.isSocket) ? req.socket : undefined (req.isSocket) ? req.socket : undefined
); );
return res.ok(student); return res.ok(student);
});
} }
}) })
}).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