diff --git a/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js b/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js index 63f4c228a..669f7c0d9 100644 --- a/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js +++ b/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js @@ -61,7 +61,9 @@ export default class KubeCustomTemplatesViewController { } try { + var template = _.find(this.templates, { Id: templateId }); await this.CustomTemplateService.remove(templateId); + this.Notifications.success('Template successfully deleted', template && template.Title); _.remove(this.templates, { Id: templateId }); } catch (err) { this.Notifications.error('Failure', err, 'Failed to delete template'); diff --git a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js index a4290e9e1..5648d25ad 100644 --- a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js +++ b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js @@ -213,7 +213,9 @@ class CustomTemplatesViewController { } try { + var template = _.find(this.templates, { Id: templateId }); await this.CustomTemplateService.remove(templateId); + this.Notifications.success('Template successfully deleted', template && template.Title); _.remove(this.templates, { Id: templateId }); } catch (err) { this.Notifications.error('Failure', err, 'Failed to delete template');