diff --git a/src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.tsx b/src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.tsx index da8498e3a..0556519c4 100644 --- a/src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.tsx +++ b/src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.tsx @@ -39,10 +39,10 @@ const ModifyEducationModal: FC = (props: ModifyEducat = useState(props.education?.length === 0 || false) const [formValues, setFormValues]: [ - { [key: string]: string | boolean | Date | undefined }, - Dispatch> + { [key: string]: string | boolean | Date | number | undefined }, + Dispatch> ] - = useState<{ [key: string]: string | boolean | Date | undefined }>({}) + = useState<{ [key: string]: string | boolean | Date | number | undefined }>({}) const [formErrors, setFormErrors]: [ { [key: string]: string }, @@ -91,9 +91,14 @@ const ModifyEducationModal: FC = (props: ModifyEducat } function handleFormValueChange(key: string, event: React.ChangeEvent): void { + + const value = key === 'endYear' + ? Number(event.target.value) + : event.target.value + setFormValues({ ...formValues, - [key]: event.target.value, + [key]: value, }) } @@ -266,11 +271,11 @@ const ModifyEducationModal: FC = (props: ModifyEducat />