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

Check warning on line 283 in src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts#L282-L283

Added lines #L282 - L283 were not covered by tests
}));
}
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.