From 839ef240af7a9678fc4692b42cd0526b0917dbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 22 Nov 2021 21:50:20 +0200 Subject: [PATCH] Navigate to dossier after deleting file --- .../file-actions/file-actions.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts index 1ff371a7b..94460b6a1 100644 --- a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts @@ -111,12 +111,13 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy, }), async () => { this._loadingService.start(); - await this._fileManagementService - .delete([this.file.fileId], this.file.dossierId) - .toPromise() - .catch(error => { - this._toaster.error(_('error.http.generic'), { params: error }); - }); + try { + const dossier = this.dossiersService.find(this.file.dossierId); + await this._fileManagementService.delete([this.file.fileId], this.file.dossierId).toPromise(); + await this._router.navigate([dossier.routerLink]); + } catch (error) { + this._toaster.error(_('error.http.generic'), { params: error }); + } this._loadingService.stop(); }, );