Skip to content

Commit

Permalink
117287: Prevent /api/eperson/epersons/undefined from being fired on t…
Browse files Browse the repository at this point in the history
…he create ePerson page
  • Loading branch information
alexandrevryghem committed Oct 29, 2024
1 parent 976ac76 commit 0cb5b76
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
* This method will initialise the page
*/
initialisePage() {
this.subs.push(this.epersonService.findById(this.route.snapshot.params.id).subscribe((ePersonRD: RemoteData<EPerson>) => {
this.epersonService.editEPerson(ePersonRD.payload);
}));
if (this.route.snapshot.params.id) {
this.subs.push(this.epersonService.findById(this.route.snapshot.params.id).subscribe((ePersonRD: RemoteData<EPerson>) => {
this.epersonService.editEPerson(ePersonRD.payload);
}));
}
this.firstName = new DynamicInputModel({
id: 'firstName',
label: this.translateService.instant(`${this.messagePrefix}.firstName`),
Expand Down

0 comments on commit 0cb5b76

Please sign in to comment.