refactoring and debug
This commit is contained in:
@@ -26,9 +26,6 @@ const AddFormComponent = () => {
|
||||
const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities()
|
||||
const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations()
|
||||
const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations()
|
||||
const handleCheckBoxChange = (event) => {
|
||||
setChecked(event.target.checked);
|
||||
};
|
||||
|
||||
const initialValues = {
|
||||
telephone_number: "",
|
||||
@@ -256,13 +253,9 @@ const AddFormComponent = () => {
|
||||
size="small"
|
||||
onChange={(event) => {
|
||||
const inputValue = event.target.value;
|
||||
|
||||
// Check if the input value is numeric
|
||||
if (isNaN(Number(inputValue))) {
|
||||
return; // Exit the function without making any changes
|
||||
return;
|
||||
}
|
||||
|
||||
// If the input value is numeric, update the formik field
|
||||
formik.handleChange({
|
||||
target: {
|
||||
name: "telephone_number",
|
||||
@@ -290,7 +283,9 @@ const AddFormComponent = () => {
|
||||
selectType="navgan_type"
|
||||
selectors={[
|
||||
{
|
||||
id: 1, value: "روستایی", name: "روستایی"
|
||||
id: 1,
|
||||
value: "روستایی",
|
||||
name: "روستایی"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
@@ -511,7 +506,6 @@ const AddFormComponent = () => {
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user