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