NTP-34955 | optional chaining for case id (#1083)
Co-authored-by: varnit goyal <github.cicd@navi.com> Co-authored-by: yashmantri <mantri.ramkishor@navi.com>
This commit is contained in:
@@ -85,12 +85,12 @@ export const generateOTP =
|
||||
.catch((err) => {
|
||||
// TODO: Fix status from BE
|
||||
if (
|
||||
err.response.status === API_STATUS_CODE.NOT_FOUND ||
|
||||
err.response.status === API_STATUS_CODE.BAD_REQUEST
|
||||
err?.response?.status === API_STATUS_CODE.NOT_FOUND ||
|
||||
err?.response?.status === API_STATUS_CODE.BAD_REQUEST
|
||||
) {
|
||||
dispatch(setOTPError('Enter a registered mobile number'));
|
||||
} else {
|
||||
dispatch(setOTPError(err.response?.data?.message));
|
||||
dispatch(setOTPError(err?.response?.data?.message));
|
||||
}
|
||||
})
|
||||
.finally(() => dispatch(setFormLoading(false)));
|
||||
|
||||
@@ -54,7 +54,7 @@ const PhoneNumberSelection: React.FC<IPhoneNumberSelection> = (props) => {
|
||||
return (
|
||||
<View style={GenericStyles.mt12}>
|
||||
<Text dark bold>
|
||||
{question.text}{' '}
|
||||
{question?.text || ' '}
|
||||
{isQuestionMandatory(question) && <Text style={GenericStyles.redText}>*</Text>}
|
||||
</Text>
|
||||
<SuspenseLoader
|
||||
@@ -62,7 +62,7 @@ const PhoneNumberSelection: React.FC<IPhoneNumberSelection> = (props) => {
|
||||
fallBack={
|
||||
<>
|
||||
{[...Array(6).keys()].map(() => (
|
||||
<LineLoader width="100%" height={65} style={[GenericStyles.mv8]} />
|
||||
<LineLoader width="100%" height={65} style={GenericStyles.mv8} />
|
||||
))}
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const CollectionCaseDetails: React.FC<ICaseDetails> = (props) => {
|
||||
params: { caseId, notificationId },
|
||||
},
|
||||
} = props;
|
||||
const caseDetail = useAppSelector((state: RootState) => state.allCases.caseDetails[caseId]) || {};
|
||||
const caseDetail = useAppSelector((state: RootState) => state.allCases.caseDetails?.[caseId]) || {};
|
||||
const isCallActive = useAppSelector(
|
||||
(state: RootState) => state?.activeCall?.activeCallDetails?.callActive
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user