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

39 lines
1.1 KiB

9 years ago
(function () {
var userManagementService = function ($http) {
9 years ago
//$http.defaults.headers.common['Content-Type'] = 'application/x-www-form-urlencoded'; // Set default headers
9 years ago
var getUsers = function () {
return $http.get('/usermanagement/users');
};
9 years ago
var addUser = function (user, claims) {
if (!user || claims.length === 0) {
return null;
}
9 years ago
9 years ago
var claimJson = angular.toJson(claims);
var objectToSerialize = { 'claims': claimJson };
var data = $.param(user) +"&"+ $.param(objectToSerialize);
return $http({
9 years ago
url: '/usermanagement/createuser',
method: "POST",
9 years ago
data: data
9 years ago
});
}
9 years ago
var getClaims = function() {
return $http.get('/usermanagement/claims');
}
9 years ago
return {
getUsers: getUsers,
9 years ago
addUser: addUser,
getClaims: getClaims
9 years ago
};
}
angular.module('PlexRequests').factory('userManagementService', ["$http", userManagementService]);
}());