1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Warn before delete users or links

This commit is contained in:
Anh Tuấn 2017-10-28 15:38:06 +07:00
parent a2cd017684
commit 262c849383

View File

@ -267,6 +267,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
// Delete user
$scope.deleteUser = function($event, user_id) {
if(confirm("Are you sure to delete this user?")){
var el = $($event.target);
apiCall('admin/delete_user', {
@ -275,6 +276,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
toastr.success('User successfully deleted.', 'Success');
$scope.reloadUserTables();
});
}
};
$scope.changeUserRole = function(role, user_id) {
@ -308,6 +310,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
// Delete link
$scope.deleteLink = function($event, link_ending) {
if(confirm("Are you sure to delete this link?")){
var el = $($event.target);
apiCall('admin/delete_link', {
@ -316,6 +319,7 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
toastr.success('Link successfully deleted.', 'Success');
$scope.reloadLinkTables();
});
}
};
// Disable and enable links