TP-67104 | Undefined QuoteId Fix (#10902)
Co-authored-by: Raaj Gopal <raaj.gopal@navi.com>
This commit is contained in:
@@ -2,6 +2,7 @@ export const AnalyticsEventNameConstants = {
|
||||
HI_SI_PILLS_CLICK: "hi_si_pills_click",
|
||||
HI_RN_QUOTE_PAGE_INIT: "hi_rn_quote_page_init",
|
||||
HI_RN_QUOTE_PAGE_ERROR_VIEW: "hi_rn_quote_page_error_view",
|
||||
PATCH_QUOTE_V2: "patch_quote_v2",
|
||||
};
|
||||
|
||||
export const AnalyticsEventPropertyConstants = {
|
||||
|
||||
@@ -9,14 +9,18 @@ import {
|
||||
TargetWidgetPayload,
|
||||
} from "../../actions/GenericAction";
|
||||
import {
|
||||
AnalyticsEventNameConstants,
|
||||
AnalyticsFlowNameConstant,
|
||||
AnalyticsGlobalErrorTypeConstant,
|
||||
AnalyticsMethodNameConstant,
|
||||
AnalyticsModuleNameConstant,
|
||||
} from "../../constants/AnalyticsEventsConstant";
|
||||
import { sendAsAnalyticsEvent, sendAsGlobalErrorEvent } from "../../hooks/useAnalyticsEvent";
|
||||
import {
|
||||
sendAsAnalyticsEvent,
|
||||
sendAsGlobalErrorEvent,
|
||||
} from "../../hooks/useAnalyticsEvent";
|
||||
import { logToSentry } from "../../hooks/useSentryLogging";
|
||||
import { CtaData } from "../../interface";
|
||||
import { AnalyticsEvent, CtaData } from "../../interface";
|
||||
import { ScreenData } from "../../interface/widgets/screenData/ScreenData";
|
||||
import { FinalPatchCallRequestBody } from "../../interface/widgets/widgetData/FooterWithCardWidgetData";
|
||||
import { NativeDeeplinkNavigatorModule } from "../../native-module/NativeModules";
|
||||
@@ -132,17 +136,31 @@ const WidgetActionHandler = {
|
||||
case WidgetActionTypes.PATCH_QUOTE_V2: {
|
||||
let quoteId = getQuoteIdFromCta(ctaData);
|
||||
const requestData: SumInsuredRequestData = widgetMetaData.data;
|
||||
if (!!quoteId) {
|
||||
if (!quoteId) {
|
||||
getQuoteIdFromCache().then((value) => {
|
||||
if (!!value) {
|
||||
quoteId = value;
|
||||
return updateSumInsuredData(requestData, quoteId!!);
|
||||
return updateSumInsuredData(requestData, quoteId!!)
|
||||
.then((response) => {})
|
||||
.catch((error) => {
|
||||
const errorEvent: AnalyticsEvent = {
|
||||
name: AnalyticsEventNameConstants.PATCH_QUOTE_V2
|
||||
};
|
||||
sendAsAnalyticsEvent(errorEvent);
|
||||
});
|
||||
}
|
||||
return;
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
return updateSumInsuredData(requestData, quoteId!!);
|
||||
return updateSumInsuredData(requestData, quoteId!!)
|
||||
.then((response) => {})
|
||||
.catch((error) => {
|
||||
const errorEvent: AnalyticsEvent = {
|
||||
name: AnalyticsEventNameConstants.PATCH_QUOTE_V2
|
||||
};
|
||||
sendAsAnalyticsEvent(errorEvent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user