You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/PlexRequests.UI/Content/app/userManagement/userManagementService.js

36 lines
1006 B

8 years ago
(function () {
var userManagementService = function ($http) {
$http.defaults.headers.common['Content-Type'] = 'application/json'; // Set default headers
8 years ago
var getUsers = function () {
return $http.get('/usermanagement/users');
};
8 years ago
var addUser = function (user, claims) {
if (!user || claims.length === 0) {
return null;
}
8 years ago
return $http({
8 years ago
url: '/usermanagement/createuser',
method: "POST",
data: { username: user.username, password: user.password, claims: claims, email: user.email }
8 years ago
});
}
var getClaims = function () {
8 years ago
return $http.get('/usermanagement/claims');
}
8 years ago
return {
getUsers: getUsers,
8 years ago
addUser: addUser,
getClaims: getClaims
8 years ago
};
}
angular.module('PlexRequests').factory('userManagementService', ["$http", userManagementService]);
}());