Merge pull request #346 from Safelite/defect/CSR-503

Load Insurance orders by passing account #
This commit is contained in:
Frank Rua 2022-04-15 11:46:04 -04:00 committed by GitHub
commit a29b63ad0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -1,5 +1,6 @@
import { storeActions } from "@/constants/store-actions.js"; import { storeActions } from "@/constants/store-actions.js";
import { getFunnelCookie, updateOrCreateFunnelCookie, deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js"; import { getFunnelCookie, updateOrCreateFunnelCookie, deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper.js";
import store from "@/store";
import baseMixin from "@/mixins/base-mixin"; 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. // 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 Calls API to load order given the referral number, referralDate, and referralCorrelationId
and returns the response. 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, const response = await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.LOAD_ORDER,
{ {
referralNumber: referralNumber.toString(), referralNumber: referralNumber.toString(),
referralDate: referralDate, referralDate: referralDate,
referralCorrelationId: referralCorrelationId referralCorrelationId: referralCorrelationId,
accountNumber: accountNumber?.toString()
}, false); }, false);
return response; return response;

View file

@ -415,14 +415,15 @@ export const actions = {
}); });
}, },
loadOrder(context, { referralNumber, referralDate, referralCorrelationId }) { loadOrder(context, { referralNumber, referralDate, referralCorrelationId, accountNumber}) {
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.LoadOrder.method, method: endpoints.LoadOrder.method,
endpoint: endpoints.LoadOrder.url, endpoint: endpoints.LoadOrder.url,
payload: { payload: {
referralNumber: referralNumber, referralNumber: referralNumber,
referralDate: referralDate, referralDate: referralDate,
referralCorrelationId: referralCorrelationId referralCorrelationId: referralCorrelationId,
accountNumber: accountNumber
}, },
}).then((response) => { }).then((response) => {
context.commit(storeMutations.RESET_STATE); context.commit(storeMutations.RESET_STATE);