1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

convert auth service profile methods to promises

This commit is contained in:
Kyle Spearrin
2017-03-25 10:43:19 -04:00
parent 2154607d11
commit 19203e976b
8 changed files with 162 additions and 145 deletions

View File

@@ -36,15 +36,17 @@
$scope.generalSave = function () {
$scope.generalPromise = apiService.accounts.putProfile({}, $scope.model.profile, function (profile) {
authService.setUserProfile(profile);
toastr.success('Account has been updated.', 'Success!');
authService.setUserProfile(profile).then(function (updatedProfile) {
toastr.success('Account has been updated.', 'Success!');
});
}).$promise;
};
$scope.passwordHintSave = function () {
$scope.passwordHintPromise = apiService.accounts.putProfile({}, $scope.model.profile, function (profile) {
authService.setUserProfile(profile);
toastr.success('Account has been updated.', 'Success!');
authService.setUserProfile(profile).then(function (updatedProfile) {
toastr.success('Account has been updated.', 'Success!');
});
}).$promise;
};