Commit 61a8bc7b by Jose Antonio

WS active scene

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