woodpecker/server/app/scripts/services/user.js

16 lines
435 B
JavaScript
Raw Normal View History

'use strict';
angular.module('app').service('users', ['$http', function($http) {
this.getCurrent = function() {
2014-09-30 07:43:50 +00:00
return $http.get('/api/user');
};
this.get = function(host, login) {
2014-09-30 07:43:50 +00:00
return $http.get('/api/users/'+host+'/'+login);
};
this.create = function(host, login) {
2014-09-30 07:43:50 +00:00
return $http.post('/api/users/'+host+'/'+login);
};
this.delete = function(host, login) {
2014-09-30 07:43:50 +00:00
return $http.delete('/api/users/'+host+'/'+login);
};
}]);