diff --git a/src/components/CustomInputForm/CustomInputForm.tsx b/src/components/CustomInputForm/CustomInputForm.tsx index dc7f269..9497208 100644 --- a/src/components/CustomInputForm/CustomInputForm.tsx +++ b/src/components/CustomInputForm/CustomInputForm.tsx @@ -307,6 +307,17 @@ const CustomInputForm: React.FC = ({ onChange={(newValue) => { handleDateChange(field.id, newValue); }} + slotProps={{ + textField: { + required: field.required, + }, + }} + // error={Boolean(errors[field.id])} + // slotProps={{ + // textField: { + // helperText: Boolean(errors[field.id]) && field.message, + // }, + // }} // required = {field.required ?? false}, /> diff --git a/src/components/EditStaff/EditStaff.tsx b/src/components/EditStaff/EditStaff.tsx index 1fbf96b..5a75dc3 100644 --- a/src/components/EditStaff/EditStaff.tsx +++ b/src/components/EditStaff/EditStaff.tsx @@ -165,7 +165,7 @@ const EditStaff: React.FC = async () => { label: t(`Team`), type: "combo-Obj", options: teamCombo, - value: data[key].id ?? "", + value: data[key]?.id ?? "", }; case "department": return { @@ -277,7 +277,7 @@ const EditStaff: React.FC = async () => { case "emergContactPhone": return { id: `${key}`, - label: t(`Emergency Contact Phonee`), + label: t(`Emergency Contact Phone`), type: "text", // pattern: "^\\d{8}$", message: t("input correct phone no."),