From da224b25d8250e4d3d3e1d58a51083d08d5c7103 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Thu, 18 Jun 2015 23:26:51 +0300 Subject: [PATCH] Settings: Now Updating the user via API call --- templates/js/controllers/settingsController.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/js/controllers/settingsController.js b/templates/js/controllers/settingsController.js index 81a4a98..a40122a 100644 --- a/templates/js/controllers/settingsController.js +++ b/templates/js/controllers/settingsController.js @@ -35,7 +35,13 @@ angular.module('SeHub') $scope.profileMode = "Save Profile"; $scope.profileModeIcon = "fa fa-floppy-o"; } else { - dataService.userBrodcast($scope.user); + apiService.updateUser(token, $scope.user).success(function(data){ + console.info('User Saved'); + dataService.userBrodcast($scope.user); + + }).error(function(e){ + console.error('Fail To Save User'); + }); $scope.profileMode = "Edit Profile"; $scope.profileModeIcon = "fa fa-pencil"; }