update of user data after submission

parent 63ad8475
...@@ -116,25 +116,24 @@ dashboardControllers.controller('SetupCtrl', function SetupCtrl( ...@@ -116,25 +116,24 @@ dashboardControllers.controller('SetupCtrl', function SetupCtrl(
// Modify the name in the header // Modify the name in the header
$scope.name = data.name + ' ' + data.surname; $scope.name = data.name + ' ' + data.surname;
// Modify the user data in session // Modify the user data in session
user.name = data.name; $scope.user.name = data.name;
user.surname = data.surname; $scope.user.surname = data.surname;
user.address = data.address; $scope.user.address = data.address;
user.phone = data.phone; $scope.user.phone = data.phone;
user.email = data.email; $scope.user.email = data.email;
user.lang = data.lang; $scope.user.lang = data.lang;
user.pic = data.pic; $scope.user.pic = data.pic;
user.role = data.role; $scope.user.role = data.role;
// Delete because at the beginning the variable user is bind // Delete because at the beginning the variable user is bind
// with the form // with the form
delete user.password; delete user.password;
delete user.password_confirm; delete user.password_confirm;
$window.sessionStorage.user = JSON.stringify($scope.user);
$window.sessionStorage.user = JSON.stringify(user);
// $location.path("/students"); // $location.path("/students");
$scope.$apply(); //$scope.$apply();
}) })
.error(function () { .error(function () {
ngToast.danger({ content: $translate.instant('data_no_saved') }); ngToast.danger({ content: $translate.instant('data_no_saved') });
......
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