merge mohammad plate number component
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes";
|
||||
import DataSaverOnIcon from "@mui/icons-material/DataSaverOn";
|
||||
import {Box, Button, FormControl, Grid, Stack, TextField} from "@mui/material";
|
||||
import {Box, Button, Grid, TextField} from "@mui/material";
|
||||
import {useFormik} from "formik";
|
||||
import {useTranslations} from "next-intl";
|
||||
import * as Yup from "yup";
|
||||
@@ -15,8 +15,8 @@ const AddFormComponent = () => {
|
||||
const t = useTranslations();
|
||||
const {token} = useUser();
|
||||
const requestServer = useRequest()
|
||||
const{provinceList, isLoadingProvinceList, errorProvinceList} = useProvince()
|
||||
const{cityTextField, cityList, setProvinceID}=useCities()
|
||||
const {provinceList, isLoadingProvinceList, errorProvinceList} = useProvince()
|
||||
const {cityTextField, cityList, setProvinceID} = useCities()
|
||||
|
||||
const initialValues = {
|
||||
tel_number: "",
|
||||
@@ -49,7 +49,7 @@ const AddFormComponent = () => {
|
||||
address: Yup.string().required(
|
||||
t("LoanRequest.error_message_address")
|
||||
),
|
||||
postal_code : Yup.mixed()
|
||||
postal_code: Yup.mixed()
|
||||
.test("max", `${t("LoanRequest.postal_code_max")}`, (value) => value.toString().length === 10)
|
||||
.required(
|
||||
t("LoanRequest.error_message_postal_code")
|
||||
@@ -78,7 +78,7 @@ const AddFormComponent = () => {
|
||||
city_id: Yup.string().required(t("LoanRequest.error_message_city_id")),
|
||||
national_code: Yup.mixed()
|
||||
.test("is-number", `${t("LoanRequest.national_code_number")}`,
|
||||
(value) => !isNaN(value))
|
||||
(value) => !isNaN(value))
|
||||
.test("positive", `${t("LoanRequest.national_code_positive")}`, (value) => value >= 0)
|
||||
.test("max", `${t("LoanRequest.national_code_max")}`, (value) => value.toString().length === 10)
|
||||
.required(t("LoanRequest.error_message_national_id")),
|
||||
@@ -280,7 +280,7 @@ const AddFormComponent = () => {
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2} sx={{padding : 2}}>
|
||||
<Grid item xs={12}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<PlateNumber formik={formik} />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user