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() {
|
|
|
|
return $http.get('/v1/user');
|
|
|
|
};
|
2014-07-09 21:25:11 +00:00
|
|
|
this.get = function(host, login) {
|
|
|
|
return $http.get('/v1/users/'+host+'/'+login);
|
|
|
|
};
|
|
|
|
this.create = function(host, login) {
|
|
|
|
return $http.post('/v1/users/'+host+'/'+login);
|
|
|
|
};
|
|
|
|
this.delete = function(host, login) {
|
|
|
|
return $http.delete('/v1/users/'+host+'/'+login);
|
|
|
|
};
|
2014-06-22 02:40:21 +00:00
|
|
|
}]);
|