Merge pull request #881 from Safelite/feature/CSR-984
CSR-984 only persist to Dynamo fields not in sv2/salesforce
This commit is contained in:
commit
8b6d25c76a
3 changed files with 26 additions and 12 deletions
|
|
@ -88,7 +88,7 @@ const endpoints = {
|
|||
},
|
||||
LoadSession: {
|
||||
url: "/order/api/v1/order/load-session",
|
||||
method: "GET",
|
||||
method: "POST",
|
||||
},
|
||||
ValidateZip: {
|
||||
url: "/location/api/v1/location/zip",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ export async function loadSessionIfPresent(isConceptInsurance) {
|
|||
const funnelCookie = getFunnelCookie();
|
||||
|
||||
// Do nothing if there is no cookie or session to use for loading.
|
||||
if (funnelCookie == null || funnelCookie.SavedSessionId == null) {
|
||||
if (
|
||||
funnelCookie == null ||
|
||||
funnelCookie.SavedSessionId == null ||
|
||||
funnelCookie.ReferralCorrelationId == null ||
|
||||
!funnelCookie.ReferralNumber
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +39,7 @@ export async function loadSessionIfPresent(isConceptInsurance) {
|
|||
await loadSession(
|
||||
funnelCookie.SavedSessionId,
|
||||
funnelCookie.ReferralNumber,
|
||||
funnelCookie.ReferralDate,
|
||||
funnelCookie.ReferralParentAccountNumber,
|
||||
funnelCookie.ReferralCorrelationId,
|
||||
isConceptInsurance
|
||||
|
|
@ -72,6 +78,7 @@ export async function saveSession() {
|
|||
async function loadSession(
|
||||
savedSessionId,
|
||||
referralNumber,
|
||||
referralDate,
|
||||
accountNumber,
|
||||
referralCorrelationId,
|
||||
isConceptInsurance
|
||||
|
|
@ -84,6 +91,7 @@ async function loadSession(
|
|||
{
|
||||
savedSessionId: savedSessionId?.toString(),
|
||||
referralNumber,
|
||||
referralDate,
|
||||
accountNumber,
|
||||
referralCorrelationId,
|
||||
isConceptInsurance,
|
||||
|
|
|
|||
|
|
@ -1041,22 +1041,28 @@ export const actions = {
|
|||
},
|
||||
loadSession(
|
||||
context,
|
||||
{ savedSessionId, referralNumber, referralCorrelationId, accountNumber, isConceptInsurance }
|
||||
{
|
||||
savedSessionId,
|
||||
referralNumber,
|
||||
referralDate,
|
||||
referralCorrelationId,
|
||||
accountNumber,
|
||||
isConceptInsurance,
|
||||
}
|
||||
) {
|
||||
const order = context.state.order;
|
||||
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.LoadSession.method,
|
||||
endpoint: `${
|
||||
endpoints.LoadSession.url
|
||||
}?savedSessionId=${savedSessionId?.toString()}&referralNumber=${
|
||||
referralNumber && referralNumber !== "" ? referralNumber : order.referralNumber
|
||||
}&accountNumber=${accountNumber}&referralCorrelationId=${
|
||||
referralCorrelationId !== ""
|
||||
? referralCorrelationId
|
||||
: order.referralCorrelationId
|
||||
}`,
|
||||
endpoint: endpoints.LoadSession.url,
|
||||
payload: {
|
||||
savedSessionId: savedSessionId?.toString(),
|
||||
referralNumber: referralNumber?.toString(),
|
||||
referralDate: referralDate?.toString(),
|
||||
accountNumber: accountNumber?.toString(),
|
||||
referralCorrelationId: referralCorrelationId,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// Flatten location and name properties
|
||||
|
|
|
|||
Loading…
Reference in a new issue