mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
small changes around the user management
This commit is contained in:
parent
c0641460f6
commit
ffe6bc41ac
6 changed files with 131 additions and 118 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
var controller = function ($scope, userManagementService) {
|
||||
|
||||
$scope.user = {}; // The local user to create
|
||||
$scope.user = {}; // The local user
|
||||
$scope.users = []; // list of users
|
||||
|
||||
$scope.error = false;
|
||||
|
@ -16,9 +16,6 @@
|
|||
};
|
||||
|
||||
$scope.addUser = function () {
|
||||
if ($scope.users.length === 0) {
|
||||
$scope.getUsers();
|
||||
}
|
||||
userManagementService.addUser($scope.user).then(function (data) {
|
||||
if (data.message) {
|
||||
$scope.error = true;
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
var userManagementService = function ($http) {
|
||||
|
||||
$http.defaults.headers.common['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; // Set default headers
|
||||
|
||||
var getUsers = function () {
|
||||
return $http.get('/usermanagement/users');
|
||||
};
|
||||
|
@ -11,10 +13,7 @@
|
|||
return $http({
|
||||
url: '/usermanagement/createuser',
|
||||
method: "POST",
|
||||
data: $.param(user),
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||
}
|
||||
data: $.param(user)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue