Skip to content

Commit

Permalink
fix(admin-users-edit): Display proper confirmation messages on save a…
Browse files Browse the repository at this point in the history
…nd remove
  • Loading branch information
pkozlowski-opensource committed Nov 27, 2012
1 parent 342e225 commit 65bafff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/app/admin/users/admin-users-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ angular.module('admin-users-edit',['services.crud', 'services.i18nNotifications'

.controller('UsersEditCtrl', ['$scope', '$location', 'i18nNotifications', 'user', function ($scope, $location, i18nNotifications, user) {

$scope.onSave = function () {
$scope.onSave = function (user) {
i18nNotifications.pushForNextRoute('crud.user.save.success', 'success', {id : user.$id()});
$location.path('/admin/users');
};
Expand All @@ -11,7 +11,7 @@ angular.module('admin-users-edit',['services.crud', 'services.i18nNotifications'
i18nNotifications.pushForCurrentRoute('crud.user.save.error', 'error');
};

$scope.onRemove = function() {
$scope.onRemove = function(user) {
i18nNotifications.pushForNextRoute('crud.user.remove.success', 'success', {id : user.$id()});
};

Expand Down
2 changes: 1 addition & 1 deletion client/test/unit/app/admin/users/admin-usersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('admin users', function () {
});

it('should call $location in onSave', function() {
$scope.onSave();
$scope.onSave({});
expect(params.i18nNotifications.pushForNextRoute).toHaveBeenCalled();
expect(params.$location.path).toHaveBeenCalled();
});
Expand Down

0 comments on commit 65bafff

Please sign in to comment.