|
|
@ -136,15 +136,15 @@
|
|
|
|
$scope.deleteUser = function () {
|
|
|
|
$scope.deleteUser = function () {
|
|
|
|
var u = $scope.selectedUser;
|
|
|
|
var u = $scope.selectedUser;
|
|
|
|
userManagementService.deleteUser(u.id)
|
|
|
|
userManagementService.deleteUser(u.id)
|
|
|
|
.then(function sucess(data) {
|
|
|
|
.then(function sucess(data) {
|
|
|
|
if (data.data.result) {
|
|
|
|
if (data.data.result) {
|
|
|
|
removeUser(u.id, true);
|
|
|
|
removeUser(u.id, true);
|
|
|
|
closeSidebar();
|
|
|
|
closeSidebar();
|
|
|
|
return successCallback("Deleted User", "success");
|
|
|
|
return successCallback("Deleted User", "success");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function errorCallback(response) {
|
|
|
|
}, function errorCallback(response) {
|
|
|
|
successCallback(response, "danger");
|
|
|
|
successCallback(response, "danger");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.formatDate = function (utcDate) {
|
|
|
|
$scope.formatDate = function (utcDate) {
|
|
|
@ -159,6 +159,10 @@
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.closeSidebarClick = function() {
|
|
|
|
|
|
|
|
return closeSidebar();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function removeUser(id, current) {
|
|
|
|
function removeUser(id, current) {
|
|
|
|
$scope.users = $scope.users.filter(function (user) {
|
|
|
|
$scope.users = $scope.users.filter(function (user) {
|
|
|
|
return user.id !== id;
|
|
|
|
return user.id !== id;
|
|
|
@ -182,4 +186,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
angular.module('PlexRequests').controller('userManagementController', ["$scope", "userManagementService", "moment", controller]);
|
|
|
|
angular.module('PlexRequests').controller('userManagementController', ["$scope", "userManagementService", "moment", controller]);
|
|
|
|
}());
|
|
|
|
} ());
|