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