mirror of https://github.com/portainer/portainer
refactor(docker): remove EndpointProvider from commit [EE-5641] (#9123)
parent
f02ede00b3
commit
599d214e50
|
@ -1,14 +1,11 @@
|
||||||
angular.module('portainer.docker').factory('Commit', [
|
angular.module('portainer.docker').factory('Commit', [
|
||||||
'$resource',
|
'$resource',
|
||||||
'API_ENDPOINT_ENDPOINTS',
|
'API_ENDPOINT_ENDPOINTS',
|
||||||
'EndpointProvider',
|
function CommitFactory($resource, API_ENDPOINT_ENDPOINTS) {
|
||||||
function CommitFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
|
||||||
'use strict';
|
'use strict';
|
||||||
return $resource(
|
return $resource(
|
||||||
API_ENDPOINT_ENDPOINTS + '/:endpointId/docker/commit',
|
API_ENDPOINT_ENDPOINTS + '/:environmentId/docker/commit',
|
||||||
{
|
{},
|
||||||
endpointId: EndpointProvider.endpointID,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
commitContainer: { method: 'POST', params: { container: '@id', repo: '@repo' }, ignoreLoadingBar: true },
|
commitContainer: { method: 'POST', params: { container: '@id', repo: '@repo' }, ignoreLoadingBar: true },
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@ angular.module('portainer.docker').controller('ContainerController', [
|
||||||
const registryModel = $scope.config.RegistryModel;
|
const registryModel = $scope.config.RegistryModel;
|
||||||
const imageConfig = ImageHelper.createImageConfigForContainer(registryModel);
|
const imageConfig = ImageHelper.createImageConfigForContainer(registryModel);
|
||||||
try {
|
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);
|
Notifications.success('Image created', $transition$.params().id);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue