RED-7649: Fixed endless loading screen.

This commit is contained in:
Nicoleta Panaghiu 2023-10-05 16:37:37 +03:00
parent 0cb4ffd8b4
commit a9a2a96208

View File

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