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