User profile editing and password
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
(function () {
|
||||
window.app.factory('userSvc',
|
||||
(function() {
|
||||
window.app.factory("userSvc",
|
||||
[
|
||||
"$http",
|
||||
function($http) {
|
||||
var users = [];
|
||||
|
||||
@@ -15,28 +17,29 @@
|
||||
return svc;
|
||||
|
||||
function loadUsers() {
|
||||
$http.post('/User/All')
|
||||
$http.post("/User/All")
|
||||
.success(function(data) {
|
||||
users.addRange(data);
|
||||
});
|
||||
}
|
||||
|
||||
function exportusers() {
|
||||
return $http.post('/User/Export', {}, { responseType: 'arraybuffer' });
|
||||
return $http.post("/User/Export", {}, { responseType: "arraybuffer" });
|
||||
}
|
||||
|
||||
function create(user) {
|
||||
return $http.post('/User/Create', user)
|
||||
return $http.post("/User/Create", user)
|
||||
.success(function(user) {
|
||||
users.unshift(user);
|
||||
});
|
||||
}
|
||||
|
||||
function edit(existingUser, editedUser) {
|
||||
return $http.post('/User/Edit', editedUser)
|
||||
return $http.post("/User/Edit", editedUser)
|
||||
.success(function(user) {
|
||||
angular.copy(user, existingUser);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
]);
|
||||
})();
|
||||
Reference in New Issue
Block a user