diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index 1ce2ac2cc..f2126b96a 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -1,5 +1,6 @@ import { storeActions } from "@/constants/store-actions.js"; import { getFunnelCookie, updateOrCreateFunnelCookie, deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js"; +import store from "@/store"; import baseMixin from "@/mixins/base-mixin"; /* @@ -25,7 +26,7 @@ export async function loadOrderIfPresent() { // Load referral if there is a cookie, and it doesn't indicate it needs a state reset. - return (await loadOrder(funnelCookie.ReferralNumber, funnelCookie.ReferralDate, funnelCookie.ReferralCorrelationId)).data; + return (await loadOrder(funnelCookie.ReferralNumber, funnelCookie.ReferralDate, funnelCookie.ReferralCorrelationId, store.getters.order.parentAccountNumber)).data; } /* @@ -54,12 +55,13 @@ export async function saveOrder() { Calls API to load order given the referral number, referralDate, and referralCorrelationId and returns the response. */ -async function loadOrder(referralNumber, referralDate, referralCorrelationId) { +async function loadOrder(referralNumber, referralDate, referralCorrelationId, accountNumber) { const response = await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.LOAD_ORDER, { referralNumber: referralNumber.toString(), referralDate: referralDate, - referralCorrelationId: referralCorrelationId + referralCorrelationId: referralCorrelationId, + accountNumber: accountNumber?.toString() }, false); return response; diff --git a/src/store/index.js b/src/store/index.js index 4564e967f..d976710ce 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -415,14 +415,15 @@ export const actions = { }); }, - loadOrder(context, { referralNumber, referralDate, referralCorrelationId }) { + loadOrder(context, { referralNumber, referralDate, referralCorrelationId, accountNumber}) { return globalMethods.callHttpClient({ method: endpoints.LoadOrder.method, endpoint: endpoints.LoadOrder.url, payload: { referralNumber: referralNumber, referralDate: referralDate, - referralCorrelationId: referralCorrelationId + referralCorrelationId: referralCorrelationId, + accountNumber: accountNumber }, }).then((response) => { context.commit(storeMutations.RESET_STATE);