LFFE-11 Remove navgan code from register and bring back navgan code in add loan request

This commit is contained in:
2023-11-05 16:07:08 +03:30
parent c17a123391
commit 66365f7267
3 changed files with 40 additions and 32 deletions

View File

@@ -140,7 +140,7 @@
"text_field_enter_your_province_id": "استان خود را وارد کنید",
"text_field_navgan_id": "شماره ناوگان",
"text_field_enter_your_navgan_id": "شماره ناوگان خود را وارد کنید",
"text_field_national_id": "کد ملی",
"text_field_national_code": "کد ملی",
"text_field_enter_your_national_id": "کد ملی خود را وارد کنید",
"text_field_shenasname_id": "شماره شناسنامه",
"text_field_enter_your_shenasname_id": "شماره شناسنامه خود را وارد کنید",

View File

@@ -81,7 +81,8 @@ const AddFormComponent = () => {
phone_number: "",
vehicle_type: "",
plate_number: "",
province: "",
province_id: "",
navgan_id: "",
national_code: "",
shenasname_id: "",
national_card_img: null,
@@ -101,7 +102,8 @@ const AddFormComponent = () => {
plate_number: Yup.string().required(
t("LoanRequest.error_message_plate_number")
),
province: Yup.string().required(t("LoanRequest.error_message_province")),
navgan_id: Yup.string().required(t("LoanRequest.error_message_navgan_id")),
province_id: Yup.string().required(t("LoanRequest.error_message_province_id")),
national_code: Yup.string().required(
t("LoanRequest.error_message_national_code")
),
@@ -119,7 +121,8 @@ const AddFormComponent = () => {
formData.append("phone_number", values.phone_number);
formData.append("vehicle_type", values.vehicle_type);
formData.append("plate_number", values.plate_number);
formData.append("province_id", values.province);
formData.append("province_id", values.province_id);
formData.append("navgan_id", values.navgan_id);
formData.append("national_code", values.national_code);
formData.append("shenasname_id", values.shenasname_id);
if (values.shenasname_img != null)
@@ -300,20 +303,20 @@ const AddFormComponent = () => {
}}
>
<Field
name="province"
label={t("LoanRequest.text_field_province")} // t("LoanRequest.text_field_enter_your_province")
name="province_id"
label={t("LoanRequest.text_field_province_id")} // t("LoanRequest.text_field_enter_your_province")
size="small"
selectType="province"
selectType="province_id"
component={SelectBox}
selectors={provinceList}
select={props.values.province}
select={props.values.province_id}
setFieldValue={props.setFieldValue}
setFieldTouched={props.setFieldTouched}
error={
props.touched.gender && props.errors.province ? true : false
props.touched.gender && props.errors.province_id ? true : false
}
helperText={
props.touched.gender ? props.errors.province : null
props.touched.gender ? props.errors.province_id : null
}
/>
</Box>
@@ -327,6 +330,33 @@ const AddFormComponent = () => {
width: "100%",
}}
>
<Box
sx={{
mx: {xs: 0, sm: 2},
my: 2,
width: "100%",
}}
>
<Field
as={TextField}
sx={{width: "100%"}}
name="navgan_id"
variant="outlined"
size="small"
label={t("LoanRequest.text_field_navgan_id")}
placeholder={t("LoanRequest.text_field_enter_your_navgan_id")}
type={"text"}
error={
props.touched.navgan_id && props.errors.navgan_id
? true
: false
}
fullWidth
helperText={
props.touched.navgan_id ? props.errors.navgan_id : null
}
/>
</Box>
<Box
sx={{
mx: {xs: 0, sm: 2},

View File

@@ -29,7 +29,6 @@ const UserRegisterComponent = ({
verification_code: "",
phone_number: PhoneNumber,
national_id: "",
navgan_id: "",
};
const validationSchema = Yup.object().shape({
@@ -39,7 +38,6 @@ const UserRegisterComponent = ({
national_id: Yup.string().required(
t("RegisterPage.error_message_national_id")
),
navgan_id: Yup.string().required(t("RegisterPage.error_message_navgan_id")),
});
const handleSubmit = (values, props) => {
@@ -47,7 +45,6 @@ const UserRegisterComponent = ({
auth: false, data: {
type_id: values.type_id,
national_id: values.national_id,
navgan_id: values.navgan_id,
phone_number: values.phone_number,
verification_code: values.verification_code,
}
@@ -151,25 +148,6 @@ const UserRegisterComponent = ({
: null
}
/>
<Field
as={TextField}
name="navgan_id"
variant="outlined"
label={t("RegisterPage.text_field_navgan_id")}
placeholder={t(
"RegisterPage.text_field_enter_your_navgan_id"
)}
type={"text"}
error={
!!(props.touched.navgan_id && props.errors.navgan_id)
}
fullWidth
helperText={
props.touched.navgan_id
? props.errors.navgan_id
: null
}
/>
<Button
fullWidth
type="submit"