From a9a2a96208b41cb6edb0a8cb05fc90e918254b90 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 5 Oct 2023 16:37:37 +0300 Subject: [PATCH] RED-7649: Fixed endless loading screen. --- .../add-edit-justification-dialog.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/justifications/add-edit-justification-dialog/add-edit-justification-dialog.component.ts b/apps/red-ui/src/app/modules/admin/screens/justifications/add-edit-justification-dialog/add-edit-justification-dialog.component.ts index 4749cf685..19629c91e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/justifications/add-edit-justification-dialog/add-edit-justification-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/justifications/add-edit-justification-dialog/add-edit-justification-dialog.component.ts @@ -26,8 +26,12 @@ export class AddEditJustificationDialogComponent extends BaseDialogComponent { const dossierTemplateId = this.data.dossierTemplateId; this._loadingService.start(); - await firstValueFrom(this._justificationService.createOrUpdate(this.form.getRawValue() as Justification, dossierTemplateId)); - await firstValueFrom(this._justificationService.loadAll(dossierTemplateId)); + try { + await firstValueFrom(this._justificationService.createOrUpdate(this.form.getRawValue() as Justification, dossierTemplateId)); + await firstValueFrom(this._justificationService.loadAll(dossierTemplateId)); + } catch (error) { + this._toaster.error(null, { error }); + } this._loadingService.stop(); this._dialogRef.close(true); }