From 7442e48ba52342dc422aced1ec95059abfe078c4 Mon Sep 17 00:00:00 2001 From: brydon1 Date: Thu, 31 Aug 2023 13:27:58 -0400 Subject: [PATCH] Setting values based on save session output --- src/store/index.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 2765a5f2..b2b9d9df 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -92,8 +92,6 @@ const getDefaultState = () => ({ coverageStatus: coverageStatuses.PENDING } }, - referralNumber: null, - referralDate: null, contactInfo: { firstName: null, lastName: null, @@ -108,7 +106,13 @@ const getDefaultState = () => ({ endTime: null, routeCode: null, jobMaxMinutes: null - } + }, + referralNumber: null, + referralDate: null, + referralCorrelationId: null, + referralSequenceNumber: null, + eon: null, + workOrderNumber: null }, applicationUser: { experiments: [], @@ -782,11 +786,24 @@ export const useMainStore = defineStore({ jobMaxMinutes: schedule.jobMaxMinutes }, referralDate: this.order.referralDate, - referralNumber: this.order.referralNumber?.toString() + referralNumber: this.order.referralNumber?.toString(), + referralCorrelationId: this.order.referralCorrelationId, + referralSequenceNumber: this.order.referralSequenceNumber, + eon: this.order.eon }, additionalSuccessEventDataHandler: (response) => `Email provided: ${customer.emailAddress ? 'true' : 'false'}` }).then((response) => { + if (referralNumber === null) { + this.order.referralNumber = response.referralNumber; + this.order.referralSequenceNumber = response.referralSequenceNumber; + this.order.referralDate = response.referralDate; + this.order.referralCorrelationId = response.referralCorrelationId; + this.order.eon = response.eon; + this.order.workOrderNumber = response.workOrderNumber; + this.applicationUser.savedSessionId = response.savedSessionId; + this.applicationUser.crmCustomerId = response.crmCustomerId; + } return resolve(response); }).catch((error) => { return reject(error);