diff --git a/app/portainer/rest/stack.js b/app/portainer/rest/stack.js index d1c749367..1aab47b3f 100644 --- a/app/portainer/rest/stack.js +++ b/app/portainer/rest/stack.js @@ -16,8 +16,8 @@ function StackFactory($resource, API_ENDPOINT_STACKS) { remove: { method: 'DELETE', params: { id: '@id', external: '@external', endpointId: '@endpointId' } }, getStackFile: { method: 'GET', params: { id: '@id', action: 'file' } }, migrate: { method: 'POST', params: { id: '@id', action: 'migrate', endpointId: '@endpointId' }, ignoreLoadingBar: true }, - start: { method: 'POST', params: { id: '@id', action: 'start' } }, - stop: { method: 'POST', params: { id: '@id', action: 'stop' } }, + start: { method: 'POST', params: { id: '@id', action: 'start', endpointId: '@endpointId' } }, + stop: { method: 'POST', params: { id: '@id', action: 'stop', endpointId: '@endpointId' } }, updateGit: { method: 'PUT', params: { id: '@id', action: 'git', subaction: 'redeploy' } }, updateGitStackSettings: { method: 'POST', params: { id: '@id', action: 'git' }, ignoreLoadingBar: true }, } diff --git a/app/portainer/services/api/stackService.js b/app/portainer/services/api/stackService.js index 80d3bd11e..5adfd4b49 100644 --- a/app/portainer/services/api/stackService.js +++ b/app/portainer/services/api/stackService.js @@ -421,13 +421,13 @@ angular.module('portainer.app').factory('StackService', [ }; service.start = start; - function start(id) { - return Stack.start({ id }).$promise; + function start(endpointId, id) { + return Stack.start({ id, endpointId }).$promise; } service.stop = stop; - function stop(id) { - return Stack.stop({ id }).$promise; + function stop(endpointId, id) { + return Stack.stop({ endpointId, id }).$promise; } function updateGit(id, endpointId, env, prune, gitConfig, pullImage) { diff --git a/app/portainer/views/stacks/edit/stackController.js b/app/portainer/views/stacks/edit/stackController.js index 49e1836a6..dd5850471 100644 --- a/app/portainer/views/stacks/edit/stackController.js +++ b/app/portainer/views/stacks/edit/stackController.js @@ -293,7 +293,7 @@ angular.module('portainer.app').controller('StackController', [ $scope.state.actionInProgress = true; try { - await StackService.stop($scope.stack.Id); + await StackService.stop(endpoint.Id, $scope.stack.Id); $state.reload(); } catch (err) { Notifications.error('Failure', err, 'Unable to stop stack'); @@ -309,7 +309,7 @@ angular.module('portainer.app').controller('StackController', [ $scope.state.actionInProgress = true; const id = $scope.stack.Id; try { - await StackService.start(id); + await StackService.start(endpoint.Id, id); $state.reload(); } catch (err) { Notifications.error('Failure', err, 'Unable to start stack');