@mychoice/mychoice-sdk-store 2.1.2 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { DataHandlerRequestState } from '../shared';
2
2
  export type UseHandlerQuoteInterface = DataHandlerRequestState & {
3
3
  postRequestQuoteOnliaUrl: (isLoader: boolean, redirectUrl: string) => void;
4
- postRequestQuote: (isRecalc: boolean) => void;
4
+ postRequestQuote: (isRecalc: boolean, hasToBeConfirmed?: boolean) => void;
5
5
  postPerformLeadsAction?: () => void;
6
6
  };
package/dist/cjs/index.js CHANGED
@@ -4885,7 +4885,7 @@ const CarQuoteDataHandler = () => {
4885
4885
  // updateViewLoader({ type: viewLoaderActionTypes.UpdateLoader, payload: false });
4886
4886
  // updateLocalState({ type: DataManagerActionTypes.RequestState, payload: requestStatusTypes.Error });
4887
4887
  // }
4888
- const constructRequestBody = (isRecalc) => {
4888
+ const constructRequestBody = (isRecalc, hasToBeConfirmed) => {
4889
4889
  const vehicles = mychoiceSdkComponents.deepClone(vehicleState).items;
4890
4890
  const drivers = mychoiceSdkComponents.deepClone(driverState).items;
4891
4891
  const postal = mychoiceSdkComponents.deepClone(postalState).item;
@@ -4912,6 +4912,9 @@ const CarQuoteDataHandler = () => {
4912
4912
  requestBody.quoterInfo.recalculate = isRecalc;
4913
4913
  delete requestBody.isValid;
4914
4914
  delete requestBody.inValidation;
4915
+ if (hasToBeConfirmed !== undefined) {
4916
+ requestBody.quoterInfo.hasToBeConfirmed = hasToBeConfirmed;
4917
+ }
4915
4918
  if (requestBody.quoterInfo?.utmSource === '') {
4916
4919
  if (partnerState.urlPath !== mychoiceSdkComponents.defaultLocalIndex && partnerState.urlPath !== '') {
4917
4920
  requestBody.quoterInfo.utmSource = partnerState.urlPath;
@@ -5151,7 +5154,7 @@ const CarQuoteDataHandler = () => {
5151
5154
  }
5152
5155
  }
5153
5156
  };
5154
- const postRequestQuote = async (isRecalc = false) => {
5157
+ const postRequestQuote = async (isRecalc = false, hasConfirmStep) => {
5155
5158
  const quoteLocalState = JSON.parse(localStorage.getItem('insurance_car_quotes') || '{}');
5156
5159
  const { isRequested } = quoteLocalState;
5157
5160
  // if (appConfigState.appType === AppTypes.TheBig) {
@@ -5177,7 +5180,7 @@ const CarQuoteDataHandler = () => {
5177
5180
  else {
5178
5181
  openLoader('Please wait while we fetch your lowest rates from our insurance partners.');
5179
5182
  }
5180
- const requestBody = constructRequestBody(quoteState.isRequested || isRecalc);
5183
+ const requestBody = constructRequestBody(quoteState.isRequested || isRecalc, hasConfirmStep);
5181
5184
  if (requestBody) {
5182
5185
  try {
5183
5186
  const response = await httpRequest({