@mychoice/mychoice-sdk-store 2.0.0 → 2.0.2

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.
Files changed (57) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/handlers/dataHandlers/PostalDataHandler/PostalDataHandler.d.ts +1 -1
  3. package/dist/cjs/handlers/dataHandlers/QuoteDataHandler/interfaces.d.ts +1 -0
  4. package/dist/cjs/handlers/dataHandlers/VehicleDataHandlers/interfaces.d.ts +1 -1
  5. package/dist/cjs/handlers/dataHandlers/shared/dataReducer/interfaces.d.ts +1 -1
  6. package/dist/cjs/index.js +42 -1
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/services/httpRequest/interfaces.d.ts +1 -1
  9. package/dist/cjs/states/StoreProvider.d.ts +1 -1
  10. package/dist/cjs/states/reducers/states/ConfigState/AppConfigState/interfaces.d.ts +1 -1
  11. package/dist/cjs/states/reducers/states/ConfigState/AppDeviceState/interfaces.d.ts +1 -1
  12. package/dist/cjs/states/reducers/states/ConfigState/AppModalState/interfaces.d.ts +1 -1
  13. package/dist/cjs/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -1
  14. package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/DriverInfoState/interfaces.d.ts +1 -1
  15. package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/DriverLicenceState/interfaces.d.ts +1 -1
  16. package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/helper.d.ts +1 -1
  17. package/dist/cjs/states/reducers/states/formStates/FormCarState/DriverState/interfaces.d.ts +1 -1
  18. package/dist/cjs/states/reducers/states/formStates/FormCarState/QuoteState/actions.d.ts +2 -1
  19. package/dist/cjs/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +8 -0
  20. package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +1 -1
  21. package/dist/cjs/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +1 -1
  22. package/dist/cjs/states/reducers/states/formStates/FormHomeState/AddressState/interfaces.d.ts +2 -2
  23. package/dist/cjs/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +1 -1
  24. package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/helper.d.ts +1 -1
  25. package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/interfaces.d.ts +1 -1
  26. package/dist/cjs/states/reducers/states/formStates/FormHomeState/DwellingState/localStore.d.ts +1 -1
  27. package/dist/cjs/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +1 -1
  28. package/dist/cjs/states/reducers/states/formStates/shared/helpers.d.ts +1 -1
  29. package/dist/esm/handlers/dataHandlers/PostalDataHandler/PostalDataHandler.d.ts +1 -1
  30. package/dist/esm/handlers/dataHandlers/QuoteDataHandler/interfaces.d.ts +1 -0
  31. package/dist/esm/handlers/dataHandlers/VehicleDataHandlers/interfaces.d.ts +1 -1
  32. package/dist/esm/handlers/dataHandlers/shared/dataReducer/interfaces.d.ts +1 -1
  33. package/dist/esm/index.js +42 -1
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/services/httpRequest/interfaces.d.ts +1 -1
  36. package/dist/esm/states/StoreProvider.d.ts +1 -1
  37. package/dist/esm/states/reducers/states/ConfigState/AppConfigState/interfaces.d.ts +1 -1
  38. package/dist/esm/states/reducers/states/ConfigState/AppDeviceState/interfaces.d.ts +1 -1
  39. package/dist/esm/states/reducers/states/ConfigState/AppModalState/interfaces.d.ts +1 -1
  40. package/dist/esm/states/reducers/states/formStates/FormCarState/DiscountState/interfaces.d.ts +1 -1
  41. package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/DriverInfoState/interfaces.d.ts +1 -1
  42. package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/DriverLicenceState/interfaces.d.ts +1 -1
  43. package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/helper.d.ts +1 -1
  44. package/dist/esm/states/reducers/states/formStates/FormCarState/DriverState/interfaces.d.ts +1 -1
  45. package/dist/esm/states/reducers/states/formStates/FormCarState/QuoteState/actions.d.ts +2 -1
  46. package/dist/esm/states/reducers/states/formStates/FormCarState/QuoteState/interfaces.d.ts +8 -0
  47. package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/helper.d.ts +1 -1
  48. package/dist/esm/states/reducers/states/formStates/FormCarState/VehicleState/interfaces.d.ts +1 -1
  49. package/dist/esm/states/reducers/states/formStates/FormHomeState/AddressState/interfaces.d.ts +2 -2
  50. package/dist/esm/states/reducers/states/formStates/FormHomeState/DiscountState/interfaces.d.ts +1 -1
  51. package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/helper.d.ts +1 -1
  52. package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/interfaces.d.ts +1 -1
  53. package/dist/esm/states/reducers/states/formStates/FormHomeState/DwellingState/localStore.d.ts +1 -1
  54. package/dist/esm/states/reducers/states/formStates/FormLifeState/ApplicantState/interfaces.d.ts +1 -1
  55. package/dist/esm/states/reducers/states/formStates/shared/helpers.d.ts +1 -1
  56. package/dist/index.d.ts +12 -2
  57. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { AxiosError, AxiosResponse, CancelToken, Method } from 'axios';
2
- import { RequestTypes, HttpRequestHeaderTypes } from '@groksmith/mychoice-sdk-components';
2
+ import { RequestTypes, HttpRequestHeaderTypes } from '@mychoice/mychoice-sdk-components';
3
3
  export type HTTPRequestParamsTypes = never | null;
4
4
  export type DefaultResponseData = {
5
5
  count: number;
@@ -1,2 +1,2 @@
1
- import { SdkFC } from '@groksmith/mychoice-sdk-components';
1
+ import { SdkFC } from '@mychoice/mychoice-sdk-components';
2
2
  export declare const StoreProvider: SdkFC;
@@ -1,4 +1,4 @@
1
- import { AppTypes, InsuranceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { AppTypes, InsuranceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreConfigAppConfigActionTypes } from './actions';
3
3
  export interface AppConfigStateInterface {
4
4
  isReady: boolean;
@@ -1,4 +1,4 @@
1
- import { DeviceTypes, ScreenBPTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { DeviceTypes, ScreenBPTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreConfigAppDeviceActionTypes } from './actions';
3
3
  export interface DeviceScreenInterface {
4
4
  width: number;
@@ -1,4 +1,4 @@
1
- import { ModalTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { ModalTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreConfigAppModalActionTypes } from './actions';
3
3
  export interface AppModalStateInterface {
4
4
  isOpen: boolean;
@@ -1,4 +1,4 @@
1
- import { DriverPriorityTypes, ValidationStatusTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { DriverPriorityTypes, ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormCarDiscountActionTypes } from './actions';
3
3
  import { StateBaseInterface } from '../../shared';
4
4
  export interface DiscountQuoterInfoInterface {
@@ -1,4 +1,4 @@
1
- import { OccupationTypes, GenderTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { OccupationTypes, GenderTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormCarDriverInfoActionTypes } from './actions';
3
3
  import { BirthDatePayloadType, FormCarDriverStateInterface } from '../interfaces';
4
4
  export type FormCarDriverInfoStateActionType = {
@@ -1,4 +1,4 @@
1
- import { DriverLicenceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { DriverLicenceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormCarDriverLicenceActionTypes } from './actions';
3
3
  import { FormCarDriverStateInterface, LicenceDatePayloadType } from '../interfaces';
4
4
  import { FormCarConfigStateInterface } from '../../ConfigState';
@@ -1,4 +1,4 @@
1
- import { DateTypes, SelectDateInterface } from '@groksmith/mychoice-sdk-components';
1
+ import { DateTypes, SelectDateInterface } from '@mychoice/mychoice-sdk-components';
2
2
  import { BirthDatePayloadType, FormCarDriverStateInterface, LicenceAgePayloadType, LicenceDatePayloadType, LicenceTypePayloadType } from './interfaces';
3
3
  export declare const setDriverProperty: (state: FormCarDriverStateInterface, name: string, value: boolean) => FormCarDriverStateInterface;
4
4
  export declare const removeDriverItem: (state: FormCarDriverStateInterface, driverIndex: number) => FormCarDriverStateInterface;
@@ -1,4 +1,4 @@
1
- import { DriverLicenceTypes, GenderTypes, OccupationTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { DriverLicenceTypes, GenderTypes, OccupationTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StateBaseInterface, TabStateInterface } from '../../shared';
3
3
  import { FormCarConfigStateInterface } from '../ConfigState';
4
4
  export interface DriverLicenceInterface {
@@ -5,5 +5,6 @@ export declare enum StoreFormCarQuoteActionTypes {
5
5
  FormCarQuotesSet = "FormCarQuotesSet",
6
6
  FormCarQuoteGetLocal = "FormCarQuoteGetLocal",
7
7
  FormCarQuoteClear = "FormCarQuoteClear",
8
- UpdateCarCallMessage = "UpdateCarCallMessage"
8
+ UpdateCarCallMessage = "UpdateCarCallMessage",
9
+ FormCarQuoteConfirmStepSet = "FormCarQuoteConfirmStepSet"
9
10
  }
@@ -21,12 +21,14 @@ export interface CarQuoteItemInterface {
21
21
  id: number | null;
22
22
  priceMonthly: string;
23
23
  priceYearly: string;
24
+ confirmQuote?: boolean;
24
25
  }
25
26
  export interface FormCarQuoteStateInterface {
26
27
  items: CarQuoteItemInterface[];
27
28
  isRequested: boolean;
28
29
  requestDate: string;
29
30
  showCallMessage: boolean;
31
+ quoteConfirm?: boolean;
30
32
  }
31
33
  export type FormCarQuoteStateActionType = {
32
34
  type: StoreFormCarQuoteActionTypes.FormCarQuoteIsRequestedSet;
@@ -60,6 +62,12 @@ export type FormCarQuoteStateActionType = {
60
62
  showCallMessage: boolean;
61
63
  };
62
64
  localIndex?: string;
65
+ } | {
66
+ type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet;
67
+ payload: {
68
+ quoteConfirm: boolean;
69
+ };
70
+ localIndex?: string;
63
71
  };
64
72
  export type FormCarQuoteStateReducerInterface = (state: FormCarQuoteStateInterface, action: FormCarQuoteStateActionType) => FormCarQuoteStateInterface;
65
73
  export interface FormCarQuoteHookInterface {
@@ -1,4 +1,4 @@
1
- import { VehicleConditionTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { VehicleConditionTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { FormCarVehicleStateInterface } from './interfaces';
3
3
  export declare const removeVehicleItem: (state: FormCarVehicleStateInterface, vehicleIndex: number) => FormCarVehicleStateInterface;
4
4
  export declare const createVehicleItem: (state: FormCarVehicleStateInterface) => FormCarVehicleStateInterface;
@@ -1,4 +1,4 @@
1
- import { VehicleConditionTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { VehicleConditionTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormCarVehicleActionTypes } from './actions';
3
3
  import { StateBaseInterface, TabStateInterface } from '../../shared';
4
4
  export interface VehicleComprehensiveInterface {
@@ -6,7 +6,7 @@ export interface FormHomeAddressStateInterface extends StateBaseInterface {
6
6
  addressStreet: string;
7
7
  unitApartmentNumber: string;
8
8
  }
9
- export declare type FormHomeAddressStateActionType = {
9
+ export type FormHomeAddressStateActionType = {
10
10
  type: StoreFormHomeAddressActionTypes.FormHomeAddressValidate;
11
11
  payload: {
12
12
  inValidation: boolean;
@@ -45,7 +45,7 @@ export declare type FormHomeAddressStateActionType = {
45
45
  payload?: null;
46
46
  localIndex?: string;
47
47
  };
48
- export declare type FormHomeAddressStateReducerInterface = (state: FormHomeAddressStateInterface, action: FormHomeAddressStateActionType) => FormHomeAddressStateInterface;
48
+ export type FormHomeAddressStateReducerInterface = (state: FormHomeAddressStateInterface, action: FormHomeAddressStateActionType) => FormHomeAddressStateInterface;
49
49
  export interface FormHomeAddressHookInterface {
50
50
  addressState: FormHomeAddressStateInterface;
51
51
  dispatchAddressState: (props: FormHomeAddressStateActionType) => void;
@@ -1,4 +1,4 @@
1
- import { ValidationStatusTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormHomeDiscountActionTypes } from './actions';
3
3
  import { StateBaseInterface } from '../../shared';
4
4
  export interface QuoterInfoInterface {
@@ -1,4 +1,4 @@
1
- import { InsuranceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { FormHomeDwellingStateInterface } from './interfaces';
3
3
  export declare const setHomeCoverageProperty: (state: FormHomeDwellingStateInterface, name: string, value: number | boolean | string) => FormHomeDwellingStateInterface;
4
4
  export declare const getDwellingInitialState: (type: InsuranceTypes) => FormHomeDwellingStateInterface;
@@ -1,4 +1,4 @@
1
- import { InsuranceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormHomeDwellingActionTypes } from './actions';
3
3
  import { StateBaseInterface } from '../../shared';
4
4
  export interface DwellingHeatingItemInterface {
@@ -1,4 +1,4 @@
1
- import { InsuranceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { FormHomeDwellingStateInterface } from './interfaces';
3
3
  export declare const getInsuranceType: () => InsuranceTypes.Car | InsuranceTypes.Home | InsuranceTypes.Condo | InsuranceTypes.Tenant;
4
4
  export declare const getLocalDwellings: (localIndex?: string | undefined) => FormHomeDwellingStateInterface;
@@ -1,4 +1,4 @@
1
- import { GenderTypes, ValidationStatusTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { GenderTypes, ValidationStatusTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoreFormLifeApplicantActionTypes } from './actions';
3
3
  import { StateBaseInterface } from '../../shared';
4
4
  export interface FormLifeApplicantStateInterface extends StateBaseInterface {
@@ -1,4 +1,4 @@
1
- import { SelectDateInterface } from '@groksmith/mychoice-sdk-components';
1
+ import { SelectDateInterface } from '@mychoice/mychoice-sdk-components';
2
2
  import { StateBaseInterface } from './interfaces';
3
3
  export declare function setStateProperty<T extends StateBaseInterface>(state: T, key: string, value: string | number | boolean | SelectDateInterface | object, objectKey?: string | null): T;
4
4
  export declare function setListItemProperty<T extends StateBaseInterface>(state: T, listKey: string, itemIndex: number, itemKey: string, value: string | number | boolean): T;
@@ -1,3 +1,3 @@
1
- import { InsuranceTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { InsuranceTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { UseHandlerPostalInterface } from './interfaces';
3
3
  export declare const useHandlerPostal: (insuranceType: InsuranceTypes) => UseHandlerPostalInterface;
@@ -2,4 +2,5 @@ import { DataHandlerRequestState } from '../shared';
2
2
  export type UseHandlerQuoteInterface = DataHandlerRequestState & {
3
3
  postRequestQuoteOnliaUrl: (isLoader: boolean, redirectUrl: string) => void;
4
4
  postRequestQuote: (isRecalc: boolean) => void;
5
+ postPerformLeadsAction?: () => void;
5
6
  };
@@ -1,4 +1,4 @@
1
- import { SelectOptionInterface } from '@groksmith/mychoice-sdk-components';
1
+ import { SelectOptionInterface } from '@mychoice/mychoice-sdk-components';
2
2
  import { DataHandlerRequestState } from '../shared';
3
3
  export type UseHandlerVehicleMakeInterface = DataHandlerRequestState & {
4
4
  getVehicleMake: (year: string) => void;
@@ -1,4 +1,4 @@
1
- import { RequestStatusTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { RequestStatusTypes } from '@mychoice/mychoice-sdk-components';
2
2
  import { DataHandlerActionTypes } from './actions';
3
3
  export type DataHandlerRequestState = {
4
4
  status: RequestStatusTypes;
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { defaultLocalIndex, HttpRequestHeaderTypes, RequestTypes, ModalTypes, DeviceTypes, ScreenBPTypes, DeviceTypeWidthList, ScreenBPList, AppTypes, InsuranceTypes, VehicleConditionTypes, VehiclePrimaryUseTypes, deepClone, CoverageTypes, getFormattedDate, GenderTypes, OccupationTypes, addDaysToDate, compareDates, DriverLicenceTypes, DateTypes, getLicenceMinDate, addYearsToDate, subMonthsFromDate, getDifferenceInYears, DriverListTypes, addMonthsToDate, ValidationStatusTypes, DriverPriorityTypes, defaultBrokerPhone, subYearsFromDate, ApplicantListTypes, useEffectOnce, getInsuranceType as getInsuranceType$2, API_AUTH, RequestStatusTypes, PROFILE_API, getDaysOfMonth, getDifferenceInHours, MAX_LOCAL_STORAGE_HOURS_THEBIG, MAX_LOCAL_STORAGE_HOURS, API_APP, API_FORM_CAR, supportedProvinceCodes, API_FORM_HOME, API_FORM_LIFE } from '@groksmith/mychoice-sdk-components';
2
+ import { defaultLocalIndex, HttpRequestHeaderTypes, RequestTypes, ModalTypes, DeviceTypes, ScreenBPTypes, DeviceTypeWidthList, ScreenBPList, AppTypes, InsuranceTypes, VehicleConditionTypes, VehiclePrimaryUseTypes, deepClone, CoverageTypes, getFormattedDate, GenderTypes, OccupationTypes, addDaysToDate, compareDates, DriverLicenceTypes, DateTypes, getLicenceMinDate, addYearsToDate, subMonthsFromDate, getDifferenceInYears, DriverListTypes, addMonthsToDate, ValidationStatusTypes, DriverPriorityTypes, defaultBrokerPhone, subYearsFromDate, ApplicantListTypes, useEffectOnce, getInsuranceType as getInsuranceType$2, API_AUTH, RequestStatusTypes, PROFILE_API, getDaysOfMonth, getDifferenceInHours, MAX_LOCAL_STORAGE_HOURS_THEBIG, MAX_LOCAL_STORAGE_HOURS, API_APP, API_FORM_CAR, supportedProvinceCodes, API_FORM_HOME, API_FORM_LIFE } from '@mychoice/mychoice-sdk-components';
3
3
  import { useMemo, useReducer, useState } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
  import { Provider, useSelector, useDispatch } from 'react-redux';
@@ -2013,6 +2013,7 @@ var StoreFormCarQuoteActionTypes;
2013
2013
  StoreFormCarQuoteActionTypes["FormCarQuoteGetLocal"] = "FormCarQuoteGetLocal";
2014
2014
  StoreFormCarQuoteActionTypes["FormCarQuoteClear"] = "FormCarQuoteClear";
2015
2015
  StoreFormCarQuoteActionTypes["UpdateCarCallMessage"] = "UpdateCarCallMessage";
2016
+ StoreFormCarQuoteActionTypes["FormCarQuoteConfirmStepSet"] = "FormCarQuoteConfirmStepSet";
2016
2017
  })(StoreFormCarQuoteActionTypes || (StoreFormCarQuoteActionTypes = {}));
2017
2018
 
2018
2019
  const setQuoteStateProperty$2 = (state, name, value) => {
@@ -2039,6 +2040,8 @@ const formCarQuoteStateReducer = (state = { ...formCarQuoteInitialState }, actio
2039
2040
  return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'items', action.payload.items));
2040
2041
  case StoreFormCarQuoteActionTypes.FormCarQuoteRequestDateSet:
2041
2042
  return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'requestDate', action.payload.requestDate));
2043
+ case StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet:
2044
+ return setLocalQuotes$2(action.localIndex, setQuoteStateProperty$2(state, 'quoteConfirm', action.payload.quoteConfirm));
2042
2045
  case StoreFormCarQuoteActionTypes.FormCarQuoteGetLocal:
2043
2046
  return {
2044
2047
  ...getLocalQuotes$2(action.localIndex),
@@ -5195,6 +5198,12 @@ const CarQuoteDataHandler = () => {
5195
5198
  type: StoreFormCarQuoteActionTypes.FormCarQuotesSet,
5196
5199
  payload: { items: response.data },
5197
5200
  });
5201
+ if (discountState.quoterInfo.initial) {
5202
+ dispatchQuoteState({
5203
+ type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet,
5204
+ payload: { quoteConfirm: !!response.data?.[0]?.confirmQuote },
5205
+ });
5206
+ }
5198
5207
  setRequestState({
5199
5208
  type: DataHandlerActionTypes.SetSuccess,
5200
5209
  });
@@ -5213,6 +5222,37 @@ const CarQuoteDataHandler = () => {
5213
5222
  }
5214
5223
  }
5215
5224
  };
5225
+ const postPerformLeadsAction = async () => {
5226
+ const { firstName, lastName, phone } = discountState.quoterInfo;
5227
+ const requestBody = {
5228
+ quote_id: quoteState.items[0].id,
5229
+ first_name: firstName,
5230
+ last_name: lastName,
5231
+ phone,
5232
+ };
5233
+ openLoader('Please wait while we are finalizing your quote.');
5234
+ try {
5235
+ await httpRequest({
5236
+ url: API_FORM_CAR.POST_SEND_LEADS,
5237
+ method: RequestTypes.Post,
5238
+ data: requestBody,
5239
+ withoutToken: true,
5240
+ cancelToken,
5241
+ });
5242
+ }
5243
+ catch (error) {
5244
+ setRequestState({
5245
+ type: DataHandlerActionTypes.SetError,
5246
+ payload: 'Axios request error',
5247
+ });
5248
+ }
5249
+ // As precaution always reveal all quotes even if lead endpoint failed
5250
+ dispatchQuoteState({
5251
+ type: StoreFormCarQuoteActionTypes.FormCarQuoteConfirmStepSet,
5252
+ payload: { quoteConfirm: false },
5253
+ });
5254
+ dispatchAppLoaderState({ type: StoreConfigAppLoaderActionTypes.AppLoaderClose });
5255
+ };
5216
5256
  return ({
5217
5257
  status,
5218
5258
  successMessage,
@@ -5222,6 +5262,7 @@ const CarQuoteDataHandler = () => {
5222
5262
  responseError,
5223
5263
  postRequestQuoteOnliaUrl,
5224
5264
  postRequestQuote,
5265
+ postPerformLeadsAction,
5225
5266
  });
5226
5267
  };
5227
5268