populate student license working with websocket

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