Merge branch 'bugfix/mohammad_show_debug' into 'develop'
This commit is contained in:
@@ -26,10 +26,6 @@ const UpdateForm = ({LoanDetails, LoanId}) => {
|
||||
const occupationStates = useOccupations();
|
||||
const requestServer = useRequest();
|
||||
|
||||
useEffect(() => {
|
||||
citiesStates.setProvinceID(LoanDetails.province_id)
|
||||
}, [provinceStates]);
|
||||
|
||||
// initial values
|
||||
const initialValues = {
|
||||
national_id: LoanDetails.national_id,
|
||||
@@ -53,6 +49,10 @@ const UpdateForm = ({LoanDetails, LoanId}) => {
|
||||
};
|
||||
// end initial values
|
||||
|
||||
useEffect(() => {
|
||||
citiesStates.setProvinceID(LoanDetails.province_id)
|
||||
}, [LoanDetails.province_id]);
|
||||
|
||||
// validation
|
||||
const validationSchema = Yup.object().shape({
|
||||
postal_code: Yup.mixed()
|
||||
@@ -72,6 +72,7 @@ const UpdateForm = ({LoanDetails, LoanId}) => {
|
||||
occupation_id: Yup.string().required(t("ShowLoan.error_message_occupation_id")),
|
||||
education_id: Yup.string().required(t("ShowLoan.error_message_education_id")),
|
||||
birthday: Yup.string().required(t("ShowLoan.error_message_date_of_birth")),
|
||||
national_serial_number: Yup.string().required(t("ShowLoan.error_message_national_serial_number")),
|
||||
|
||||
});
|
||||
// end validation
|
||||
@@ -392,7 +393,20 @@ const UpdateForm = ({LoanDetails, LoanId}) => {
|
||||
placeholder={t(
|
||||
"ShowLoan.text_field_enter_your_postal_code"
|
||||
)}
|
||||
value={props.values.postal_code}
|
||||
type={'tel'}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
if (isNaN(Number(inputValue))) {
|
||||
return;
|
||||
}
|
||||
props.handleChange({
|
||||
target: {
|
||||
name: "postal_code",
|
||||
value: inputValue,
|
||||
},
|
||||
});
|
||||
}}
|
||||
error={!!(props.touched.postal_code && props.errors.postal_code)}
|
||||
fullWidth
|
||||
helperText={
|
||||
@@ -496,10 +510,21 @@ const UpdateForm = ({LoanDetails, LoanId}) => {
|
||||
sx={{width: "100%"}}
|
||||
name="telephone_number"
|
||||
variant="outlined"
|
||||
type={'tel'}
|
||||
size="small"
|
||||
type={'tel'}
|
||||
value={props.values.telephone_number}
|
||||
onChange={props.handleChange}
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
if (isNaN(Number(inputValue))) {
|
||||
return;
|
||||
}
|
||||
props.handleChange({
|
||||
target: {
|
||||
name: "telephone_number",
|
||||
value: inputValue,
|
||||
},
|
||||
});
|
||||
}}
|
||||
label={t("ShowLoan.text_field_tel_number")}
|
||||
placeholder={t(
|
||||
"ShowLoan.text_field_enter_your_tel_number"
|
||||
|
||||
Reference in New Issue
Block a user