Added a National ID/Passport field to the demographic information of a student

This commit is contained in:
Tiago Ribeiro
2024-01-11 11:05:14 +00:00
parent 174398b4f7
commit 0c9f0b3dbd
4 changed files with 61 additions and 19 deletions

View File

@@ -72,6 +72,7 @@ function UserProfile({user, mutateUser}: Props) {
const [employment, setEmployment] = useState<EmploymentStatus | undefined>(
user.type === "corporate" ? undefined : user.demographicInformation?.employment,
);
const [passport_id, setPassportID] = useState<string | undefined>(user.type === "student" ? user.demographicInformation?.passport_id : undefined);
const [position, setPosition] = useState<string | undefined>(user.type === "corporate" ? user.demographicInformation?.position : undefined);
const [companyName, setCompanyName] = useState<string | undefined>(user.type === "agent" ? user.agentInformation?.companyName : undefined);
const [commercialRegistration, setCommercialRegistration] = useState<string | undefined>(
@@ -152,6 +153,7 @@ function UserProfile({user, mutateUser}: Props) {
employment: user?.type === "corporate" ? undefined : employment,
position: user?.type === "corporate" ? position : undefined,
gender,
passport_id,
},
});
if (request.status === 200) {
@@ -193,6 +195,17 @@ function UserProfile({user, mutateUser}: Props) {
required
/>
</div>
{user.type === "student" && (
<Input
type="text"
name="passport_id"
label="Passport/National ID"
onChange={(e) => setPassportID(e)}
placeholder="Enter National ID or Passport number"
value={passport_id}
required
/>
)}
<div className="flex flex-col md:flex-row gap-8 w-full">
<Input
label="Current Password"