Merge pull request #880 from Safelite/defect/digital/SSR-1660

SSR-1660 Fix dupe check not being called on welcome page
This commit is contained in:
Josh Dassinger 2024-10-30 08:32:46 -05:00 committed by GitHub
commit 17512095c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View file

@ -471,6 +471,7 @@ export default {
},
startNewReferral() {
this.mainStore.issConfig.enableContinueFromCookie = false;
// Setting this to true so we skip dupe check since the user already decided not to load the previous referral
this.mainStore.order.loadedFromCookie = true;
this.answeredContinueModal = true;
this.$refs.continueModal.closeModal();

View file

@ -220,7 +220,7 @@ export const getDefaultState = () => ({
originalDeductible: null,
currentDeductible: null,
carrierPhoneNumber: null,
loadedFromCookie: null,
loadedFromCookie: false,
loadedFromDupeCheck: null,
loadedSessionClearedPreviousData: null,
availableVaps: null
@ -721,14 +721,18 @@ export const useMainStore = defineStore({
},
getDuplicateReferrals() {
const params = new URLSearchParams({
parentAccountNumber: this.issConfig.parentAccountNumber,
customerPhoneNumber: this.order.contactInfo.servicePhone,
policyNumber: this.order.policy.policyNumber,
emailAddress: this.order.customer.emailAddress,
dateOfLoss: this.order.policy.dateOfLoss
});
return new Promise((resolve, reject) => {
globalMethods.callHttpClient({
method: endpoints.DuplicateSearch.method,
endpoint: endpoints.DuplicateSearch.url(
this.issConfig.parentAccountNumber,
this.order.policy.policyNumber,
this.order.policy.dateOfLoss
)
endpoint: `${endpoints.DuplicateSearch.url}?${params.toString()}`
}).then((r) => {
this.applicationUser.duplicateOrders = r.data ?? [];
return resolve(r.data);
@ -2026,6 +2030,7 @@ export const useMainStore = defineStore({
this.order.availableVaps = null;
this.order.carrierPhoneNumber = null;
this.order.customerPortalLoginToken = null;
this.order.loadedFromCookie = false;
},
resetPolicy() {