diff --git a/src/components/AddJob/AddJob.jsx b/src/components/AddJob/AddJob.jsx index 5b07500..58d86c0 100644 --- a/src/components/AddJob/AddJob.jsx +++ b/src/components/AddJob/AddJob.jsx @@ -39,7 +39,7 @@ function AddJob({ popUpHandler, categories }) { try { const res = await ApiCall.jobManagerCreateJob(reqData); - if (res.data.internal_return < 1) { + if (res?.data?.internal_return < 1) { setRequestStatus({ loading: false, status: false, @@ -75,7 +75,7 @@ function AddJob({ popUpHandler, categories }) { // For form initial values const initialValues = { // initial values for formik - country: walletDetails.data.length === 1 ? walletDetails.data[0].country : '', + country: walletDetails?.data?.length === 1 ? walletDetails.data[0].country : '', price: "", title: "", description: "", @@ -117,18 +117,18 @@ function AddJob({ popUpHandler, categories }) { className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`} onChange={props.handleChange} onBlur={props.handleBlur} - disabled={walletDetails.data.length === 1} + disabled={walletDetails?.data?.length === 1} > {walletDetails?.loading ? ( - ) : walletDetails.data.length > 1 ? ( + ) : walletDetails?.data?.length > 1 ? ( <> - {walletDetails.data?.map((item, index) => ( + {walletDetails?.data?.map((item, index) => (