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 () => { async () => {
this._loadingService.start(); this._loadingService.start();
await this._fileManagementService try {
.delete([this.file.fileId], this.file.dossierId) const dossier = this.dossiersService.find(this.file.dossierId);
.toPromise() await this._fileManagementService.delete([this.file.fileId], this.file.dossierId).toPromise();
.catch(error => { await this._router.navigate([dossier.routerLink]);
this._toaster.error(_('error.http.generic'), { params: error }); } catch (error) {
}); this._toaster.error(_('error.http.generic'), { params: error });
}
this._loadingService.stop(); this._loadingService.stop();
}, },
); );