Skip to content

Register.tsx: nok_first prefilled from nextOfKin.lastName instead of firstName #923

Description

@iamtanuj18

In application/user-client/src/pages/Register.tsx line 113, the Alternative Contact First Name field is prefilled from nextOfKin?.lastName instead of nextOfKin?.firstName.
Verified two ways:

  1. Direct via Swagger - sending an invite with prefill.profile.nextOfKin where firstName and lastName differ, the register form shows both First Name and Family Name as the last name value.

  2. Via the actual admin UI - uploaded a CSV through the Participants page Import flow (ReactSpreadsheetImport wizard) with distinct next-of-kin firstName/lastName values. The wizard maps CSV columns to profile.nextOfKin.firstName / .lastName, populates the InviteModal, and after sending + clicking the invite link, the register form's Alternative Contact section shows both name fields as the last name value ("SmithLAST" in my test).

Manual invite entry via InviteModal only passes studyParticipant.externalId so that path isn't affected, but the CSV import path populates full profile.* prefill including nextOfKin.

Fix: change nextOfKin?.lastName to nextOfKin?.firstName on line 113. One-word fix.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions