fix(template) add notification when delete (#6675)

pull/6637/head^2
sunportainer 2022-04-01 14:40:08 +08:00 committed by GitHub
parent 4ddd6663f5
commit ee90fffce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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');

View File

@ -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');