harbor/static/ng/resources/js/services/project-member/services.add-project-member.js
2016-04-27 18:29:55 +08:00

25 lines
554 B
JavaScript

(function() {
'use strict';
angular
.module('harbor.services.project.member')
.factory('AddProjectMemberService', AddProjectMemberService);
AddProjectMemberService.$inject = ['$http', '$log'];
function AddProjectMemberService($http, $log) {
return AddProjectMember;
function AddProjectMember(projectId, roles, username) {
return $http
.post('/api/projects/' + projectId + '/members/', {
'roles': [ Number(roles) ],
'user_name': username
});
}
}
})();