refactor(docker): remove EndpointProvider from commit [EE-5641] (#9123)

pull/9132/head
Chaim Lev-Ari 2023-06-28 08:02:43 +07:00 committed by GitHub
parent f02ede00b3
commit 599d214e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -1,14 +1,11 @@
angular.module('portainer.docker').factory('Commit', [
'$resource',
'API_ENDPOINT_ENDPOINTS',
'EndpointProvider',
function CommitFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
function CommitFactory($resource, API_ENDPOINT_ENDPOINTS) {
'use strict';
return $resource(
API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/commit',
{
endpointId: EndpointProvider.endpointID,
},
API_ENDPOINT_ENDPOINTS + '/:environmentId/docker/commit',
{},
{
commitContainer: { method: 'POST', params: { container: '@id', repo: '@repo' }, ignoreLoadingBar: true },
}

View File

@ -260,7 +260,7 @@ angular.module('portainer.docker').controller('ContainerController', [
const registryModel = $scope.config.RegistryModel;
const imageConfig = ImageHelper.createImageConfigForContainer(registryModel);
try {
await Commit.commitContainer({ id: $transition$.params().id, repo: imageConfig.fromImage }).$promise;
await Commit.commitContainer({ environmentId: endpoint.Id }, { id: $transition$.params().id, repo: imageConfig.fromImage }).$promise;
Notifications.success('Image created', $transition$.params().id);
$state.reload();
} catch (err) {