fix(volume-browser): move volume id to query params

pull/2338/head
Chaim Lev-Ari 2018-10-07 09:55:18 +03:00
parent 3422662191
commit 9215d0f3f0
2 changed files with 9 additions and 9 deletions

View File

@ -1,22 +1,22 @@
angular.module('portainer.agent') angular.module('portainer.agent')
.factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) { .factory('Browse', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider', function BrowseFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
'use strict'; 'use strict';
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/browse/:id/:action', { return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/browse/:action', {
endpointId: EndpointProvider.endpointID endpointId: EndpointProvider.endpointID
}, },
{ {
ls: { ls: {
method: 'GET', isArray: true, params: { id: '@id', action: 'ls' } method: 'GET', isArray: true, params: { action: 'ls' }
}, },
get: { get: {
method: 'GET', params: { id: '@id', action: 'get' }, method: 'GET', params: { action: 'get' },
transformResponse: browseGetResponse transformResponse: browseGetResponse
}, },
delete: { delete: {
method: 'DELETE', params: { id: '@id', action: 'delete' } method: 'DELETE', params: { action: 'delete' }
}, },
rename: { rename: {
method: 'PUT', params: { id: '@id', action: 'rename' } method: 'PUT', params: { action: 'rename' }
} }
}); });
}]); }]);

View File

@ -4,15 +4,15 @@ angular.module('portainer.agent')
var service = {}; var service = {};
service.ls = function(volumeId, path) { service.ls = function(volumeId, path) {
return Browse.ls({ 'id': volumeId, 'path': path }).$promise; return Browse.ls({ volumeID: volumeId, path: path }).$promise;
}; };
service.get = function(volumeId, path) { service.get = function(volumeId, path) {
return Browse.get({ 'id': volumeId, 'path': path }).$promise; return Browse.get({ volumeID: volumeId, path: path }).$promise;
}; };
service.delete = function(volumeId, path) { service.delete = function(volumeId, path) {
return Browse.delete({ 'id': volumeId, 'path': path }).$promise; return Browse.delete({ volumeID: volumeId, path: path }).$promise;
}; };
service.rename = function(volumeId, path, newPath) { service.rename = function(volumeId, path, newPath) {
@ -20,7 +20,7 @@ angular.module('portainer.agent')
CurrentFilePath: path, CurrentFilePath: path,
NewFilePath: newPath NewFilePath: newPath
}; };
return Browse.rename({ 'id': volumeId }, payload).$promise; return Browse.rename({ volumeID: volumeId }, payload).$promise;
}; };
return service; return service;