refactoring and debug

This commit is contained in:
2023-12-19 13:34:51 +03:30
parent 1084430aaf
commit 14c142af52

View File

@@ -26,9 +26,6 @@ const AddFormComponent = () => {
const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities() const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities()
const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations() const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations()
const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations() const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations()
const handleCheckBoxChange = (event) => {
setChecked(event.target.checked);
};
const initialValues = { const initialValues = {
telephone_number: "", telephone_number: "",
@@ -256,13 +253,9 @@ const AddFormComponent = () => {
size="small" size="small"
onChange={(event) => { onChange={(event) => {
const inputValue = event.target.value; const inputValue = event.target.value;
// Check if the input value is numeric
if (isNaN(Number(inputValue))) { 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({ formik.handleChange({
target: { target: {
name: "telephone_number", name: "telephone_number",
@@ -290,7 +283,9 @@ const AddFormComponent = () => {
selectType="navgan_type" selectType="navgan_type"
selectors={[ selectors={[
{ {
id: 1, value: "روستایی", name: "روستایی" id: 1,
value: "روستایی",
name: "روستایی"
}, },
{ {
id: 2, id: 2,
@@ -511,7 +506,6 @@ const AddFormComponent = () => {
</> </>
) )
} }
</> </>
); );
}; };