forked from Archives/Athou_commafeed
delete users
This commit is contained in:
@@ -292,4 +292,9 @@ module.controller('ManageUserCtrl', function($scope, $state, $stateParams,
|
||||
});
|
||||
});
|
||||
};
|
||||
$scope.delete = function() {
|
||||
AdminUsersService.delete({id: $scope.user.id}, function() {
|
||||
$state.transitionTo('admin.userlist');
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -148,6 +148,12 @@ module.factory('AdminUsersService', function($resource) {
|
||||
params : {
|
||||
_method : 'save'
|
||||
}
|
||||
},
|
||||
delete : {
|
||||
method : 'DELETE',
|
||||
params : {
|
||||
_method : 'delete'
|
||||
}
|
||||
}
|
||||
};
|
||||
var res = $resource('rest/admin/users/:_method', {}, actions);
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button type="button" class="btn" ng-click="cancel()">Cancel</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="delete()">Delete</button>
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user