diff --git a/src/app/projectmanagement/modals/result/result.component.ts b/src/app/projectmanagement/modals/result/result.component.ts index 5a587fc008..788e6c1b33 100644 --- a/src/app/projectmanagement/modals/result/result.component.ts +++ b/src/app/projectmanagement/modals/result/result.component.ts @@ -59,9 +59,8 @@ export class ResultComponent implements OnInit, OnDestroy { this.setToResultState(); this.subscription.add( - this.applicationsService - .requestModification(this.extension as ApplicationModification) - .subscribe((result: { [key: string]: string }): void => { + this.applicationsService.requestModification(this.extension as ApplicationModification).subscribe( + (result: { [key: string]: string }): void => { if (result['Error']) { this.extensionStatus = 2; this.errorMessage = result['Error']; @@ -70,7 +69,12 @@ export class ResultComponent implements OnInit, OnDestroy { } this.event.emit({ reload: true }); - }), + }, + () => { + this.extensionStatus = 2; + this.errorMessage = 'Submitting the modification request was not successful. Please reload this page and try again!'; + }, + ), ); } @@ -89,12 +93,12 @@ export class ResultComponent implements OnInit, OnDestroy { ), ); } + submitLifetimeExtensionRequest(): void { this.setToResultState(); - this.applicationsService - .requestAdditionalLifetime(this.extension as ApplicationLifetimeExtension) - .subscribe((result: { [key: string]: string }): void => { + this.applicationsService.requestAdditionalLifetime(this.extension as ApplicationLifetimeExtension).subscribe( + (result: { [key: string]: string }): void => { if (result['Error']) { this.extensionStatus = 2; this.errorMessage = result['Error']; @@ -103,23 +107,32 @@ export class ResultComponent implements OnInit, OnDestroy { } this.event.emit({ reload: true }); - }); + }, + () => { + this.extensionStatus = 2; + this.errorMessage = 'Submitting the extension request was not successful. Please reload this page and try again!'; + }, + ); } submitCreditsModification(): void { this.setToResultState(); this.subscription.add( - this.applicationsService - .requestAdditionalCredits(this.extension as ApplicationCreditRequest) - .subscribe((result: { [key: string]: string }): void => { + this.applicationsService.requestAdditionalCredits(this.extension as ApplicationCreditRequest).subscribe( + (result: { [key: string]: string }): void => { if (result['Error']) { this.extensionStatus = 2; } else { this.extensionStatus = 1; } this.event.emit({ reload: true }); - }), + }, + () => { + this.extensionStatus = 2; + this.errorMessage = 'Submitting the credit request was not successful. Please reload this page and try again!'; + }, + ), ); }