2017-05-23 18:56:10 +00:00
|
|
|
angular.module('portainer.rest')
|
2017-07-20 14:22:27 +00:00
|
|
|
.factory('Teams', ['$resource', 'API_ENDPOINT_TEAMS', function TeamsFactory($resource, API_ENDPOINT_TEAMS) {
|
2017-05-23 18:56:10 +00:00
|
|
|
'use strict';
|
2017-07-20 14:22:27 +00:00
|
|
|
return $resource(API_ENDPOINT_TEAMS + '/:id/:entity/:entityId', {}, {
|
2017-05-23 18:56:10 +00:00
|
|
|
create: { method: 'POST' },
|
|
|
|
query: { method: 'GET', isArray: true },
|
|
|
|
get: { method: 'GET', params: { id: '@id' } },
|
|
|
|
update: { method: 'PUT', params: { id: '@id' } },
|
|
|
|
remove: { method: 'DELETE', params: { id: '@id'} },
|
|
|
|
queryMemberships: { method: 'GET', isArray: true, params: { id: '@id', entity: 'memberships' } }
|
|
|
|
});
|
|
|
|
}]);
|