Navigate to dossier after deleting file

This commit is contained in:
Adina Țeudan 2021-11-22 21:50:20 +02:00
parent 7863adb602
commit 839ef240af

View File

@ -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();
},
);