1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-10 08:15:25 +02:00

refactor(docker/configs): remove EndpointProvider [EE-5746] (#9198)

This commit is contained in:
Chaim Lev-Ari 2023-08-31 22:11:57 +02:00 committed by GitHub
parent cd3c6e3089
commit 1b0fd60115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 23 deletions

View file

@ -3,11 +3,12 @@ import { confirmDelete } from '@@/modals/confirm';
class ConfigsController {
/* @ngInject */
constructor($state, ConfigService, Notifications, $async) {
constructor($state, ConfigService, Notifications, $async, endpoint) {
this.$state = $state;
this.ConfigService = ConfigService;
this.Notifications = Notifications;
this.$async = $async;
this.endpoint = endpoint;
this.removeAction = this.removeAction.bind(this);
this.removeActionAsync = this.removeActionAsync.bind(this);
@ -21,7 +22,7 @@ class ConfigsController {
async getConfigsAsync() {
try {
this.configs = await this.ConfigService.configs();
this.configs = await this.ConfigService.configs(this.endpoint.Id);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to retrieve configs');
}
@ -44,7 +45,7 @@ class ConfigsController {
let actionCount = selectedItems.length;
for (const config of selectedItems) {
try {
await this.ConfigService.remove(config.Id);
await this.ConfigService.remove(this.endpoint.Id, config.Id);
this.Notifications.success('Config successfully removed', config.Name);
const index = this.configs.indexOf(config);
this.configs.splice(index, 1);