Skip to content

Commit

Permalink
Merge pull request #6003 from deNBI/fix/project_requests
Browse files Browse the repository at this point in the history
Fix/project requests
  • Loading branch information
dweinholz authored Mar 21, 2024
2 parents 9f9a602 + 399154c commit 7b7ecf9
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/app/projectmanagement/modals/result/result.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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!';
},
),
);
}

Expand All @@ -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'];
Expand All @@ -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!';
},
),
);
}

Expand Down

0 comments on commit 7b7ecf9

Please sign in to comment.