harbor/static/resources/js/services/user/services.update-user.js
2016-06-21 13:28:21 +08:00

24 lines
513 B
JavaScript

(function() {
'use strict';
angular
.module('harbor.services.user')
.factory('UpdateUserService', UpdateUserService);
UpdateUserService.$inject = ['$http'];
function UpdateUserService($http) {
return updateUser;
function updateUser(userId, user) {
return $http
.put('/api/users/' + userId, {
'username': user.username,
'email': user.email,
'realname': user.realname,
'comment': user.comment
});
}
}
})();