diff --git a/src/Components/Ambulance/AmbulanceOnboarding.tsx b/src/Components/Ambulance/AmbulanceOnboarding.tsx index 3df2b4a3c0a..1a5a980f49f 100644 --- a/src/Components/Ambulance/AmbulanceOnboarding.tsx +++ b/src/Components/Ambulance/AmbulanceOnboarding.tsx @@ -86,7 +86,6 @@ export default function AmbulanceOnboarding() { setVehicleObj(val); setValue(1); }; - console.log('vehicleObj: ', vehicleObj); return ( diff --git a/src/Components/Ambulance/DriverDetailsForm.tsx b/src/Components/Ambulance/DriverDetailsForm.tsx index 92d23218646..9a0e052c733 100644 --- a/src/Components/Ambulance/DriverDetailsForm.tsx +++ b/src/Components/Ambulance/DriverDetailsForm.tsx @@ -4,6 +4,7 @@ import { TextInputField } from '../Common/HelperInputFields'; import { useDispatch } from "react-redux"; import { postAmbulance } from "../../Redux/actions"; import { isEmpty, get } from "lodash"; +import { navigate } from 'hookrouter'; export const DriverDetailsForm = (props:any) => { @@ -43,7 +44,7 @@ export const DriverDetailsForm = (props:any) => { }; const validateData = () => { - const err = Object.assign({}); + const err:any = {}; Object.keys(form).forEach((key) => { const value = form[key]; switch (key) { @@ -76,6 +77,7 @@ export const DriverDetailsForm = (props:any) => { }); if (!isEmpty(err)) { setErrors(err); + return false; } return form; }; @@ -122,8 +124,9 @@ export const DriverDetailsForm = (props:any) => { const statusCode = get(resp, 'status', ''); if (res && statusCode === 401) { alert('Something went wrong..!'); - } else if (res && statusCode === 200) { + } else if (res && statusCode === 201) { alert('Ambulance Added Successfully'); + navigate("/") } }) } @@ -140,7 +143,8 @@ export const DriverDetailsForm = (props:any) => {