Commit 61a8bc7b by Jose Antonio

WS active scene

parent 7cc915b7
......@@ -859,12 +859,13 @@ module.exports = {
.then(student => {
student.id_active_scene=params.id_scene;
delete student.password;
delete student.username;
student.save(function(error){
if(error){
return res.serverError("Error updating active scene");
}
else{
return res.ok();
return res.ok(student);
}
})
}).catch(function(err){
......
......@@ -297,13 +297,11 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope.activate_scene = function (scene) {
$http.put(config.backend + '/stu/' + $scope.studentData.id + '/activeScene/' + scene.id, {id_scene:scene.id})
.success(function () {
var data= {
id: scene.id};
.success(function (stu) {
io.socket.post('/scene', {
action: 'activate',
scene: data
io.socket.post('/stu/config', {
action: 'update',
attributes: stu
}, function () {});
$translate('scene_updated').then(function (translation) {
......
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