From fe4764366a243aaf469f7af385afcd48f0111ae8 Mon Sep 17 00:00:00 2001 From: Josh Dassinger Date: Fri, 9 Aug 2024 09:14:14 -0500 Subject: [PATCH] Pass at making sure store fields are reset when reentering the flow --- src/store/index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 58e1b450..3c085293 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1570,6 +1570,8 @@ export const useMainStore = defineStore({ resetServiceLocationProvider() { this.order.serviceLocation.provider = { providerNumber: null, + companyName: null, + phoneNumber: null, address: { streetAddress: null, city: null, @@ -1755,10 +1757,17 @@ export const useMainStore = defineStore({ resetPolicy() { this.order.policy.policyNumber = null; + this.order.policy.policyZipCode = null; this.order.policy.dateOfLoss = null; this.order.policy.damageCause = null; this.order.policy.damageCity = null; this.order.policy.damageState = null; + this.order.policy.vehicles = []; + this.order.policy.endorsements = []; + this.order.policy.endorsementQuestionAnswers = []; + this.order.policy.policyData = null; + this.order.policy.deductible.repair = null; + this.order.policy.deductible.replace = null; }, resetCustomer() { @@ -1811,6 +1820,7 @@ export const useMainStore = defineStore({ resetGlassPartsState() { this.order.lineItems.glassParts = null; this.order.lineItems.supportingItems = null; + this.order.lineItems.vaps = null; this.order.lineItems.feeItems = []; this.order.lineItems.serverData = null; this.order.damage.partQuestionAnswers = null; @@ -2488,6 +2498,16 @@ export const useMainStore = defineStore({ this.resetServiceLocationAndDependencies(); }, + resetServiceLocation() { + this.order.serviceLocation.state = null; + this.order.serviceLocation.zipCode = null; + this.order.serviceLocation.zipCodeCtu = null; + this.order.serviceLocation.defaultProviderNumber = null; + this.order.serviceLocation.appointmentType = null; + this.order.serviceLocation.IsSafeliteProvider = null; + this.resetServiceLocationProvider(); + }, + resetPageFields() { this.resetOrder(); this.resetCustomer(); @@ -2497,6 +2517,8 @@ export const useMainStore = defineStore({ this.resetDamageState(); this.resetGlassPartsState(); this.resetInsurance(); + this.resetServiceLocation(); + this.resetSchedule(); this.resetBailout(); this.resetSubmittedOrder(); },