RED-3027: Fixed double success notification on dossier delete

This commit is contained in:
Adina Țeudan 2021-12-13 14:39:13 +02:00
parent b0d4585550
commit 8f71ab1f9d
2 changed files with 1 additions and 6 deletions

View File

@ -124,17 +124,13 @@ export class EditDossierDialogComponent extends BaseDialogComponent {
return this.activeComponent?.disabled;
}
afterSave() {
this._toaster.success(_('edit-dossier-dialog.change-successful'), { params: { dossierName: this._dossierName } });
}
async save(closeAfterSave: boolean = false) {
this._loadingService.start();
const result = await this.activeComponent.save();
this._loadingService.stop();
if (result.success) {
this.afterSave();
this._toaster.success(_('edit-dossier-dialog.change-successful'), { params: { dossierName: this._dossierName } });
}
if (result.success && closeAfterSave) {

View File

@ -116,7 +116,6 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
});
this._dialogService.openDialog('confirm', null, data, async () => {
await this._dossiersService.delete(this.dossier).toPromise();
this._editDossierDialogRef.componentInstance.afterSave();
this._editDossierDialogRef.close();
this._router.navigate(['main', 'dossiers']).then(() => this._notifyDossierDeleted());
});