From 5ac9970d655bc661c2858ac18538591c0b8f6ae4 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Fri, 1 Mar 2024 18:01:23 -0500 Subject: [PATCH] Getting rid of mainStore data property --- .../coverage-statement/coverage-statement.vue | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index 02848781..51ad2a5d 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -177,7 +177,14 @@ export default { await useMainStore().getFinalDeductible(); pricingResults = await useMainStore().getPriceOrderItems(availableLineItems) .catch((err) => { - useMainStore().setBailout(to, bailoutMessage.pricingResponseError(availableLineItems.map((li) => li.partNumber), { code: err.code, message: err.message, data: err.data })); + useMainStore() + .setBailout( + to, + bailoutMessage.pricingResponseError( + availableLineItems.map((li) => li.partNumber), + { code: err.code, message: err.message, data: err.data } + ) + ); hasBailedOut = true; next(`/?issPage=${issPageValues.BAILOUT_PAGE}`); }); @@ -198,10 +205,6 @@ export default { }); } }, - setup() { - const mainStore = useMainStore(); - return { mainStore }; - }, data() { return { availableLineItems: [], @@ -368,7 +371,7 @@ export default { }, async navigateForward() { if (this.unverified || this.verifiedDeductible) { - this.mainStore.saveSupportingItems(this.supportingItems); + useMainStore().saveSupportingItems(this.supportingItems); this.$router.navigate( navigationScenarios.CLICKED_FORWARD, this.$route, @@ -378,7 +381,7 @@ export default { } else if (this.verifiedITAC || this.verifiedNoComp) { useMainStore().updateIsSafeliteProvider(this.selectedProvider === 'Safelite'); if (this.selectedProvider === 'Safelite') { - this.mainStore.saveSupportingItems(this.supportingItems); + useMainStore().saveSupportingItems(this.supportingItems); this.$router.navigate( navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, this.$route, @@ -386,7 +389,7 @@ export default { { [routerParams.SAVE_SESSION_SYNCHRONOUS]: true } ); } else { - this.mainStore.setBailout(this.$router.currentRoute, bailoutMessage.RequestCallback()); + useMainStore().setBailout(this.$router.currentRoute, bailoutMessage.RequestCallback()); this.$router.navigate( navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP, this.$route, @@ -395,7 +398,7 @@ export default { ); } } else { - this.mainStore.setBailout(this.$router.currentRoute, bailoutMessage.coverageStatementInvalidState()); + useMainStore().setBailout(this.$router.currentRoute, bailoutMessage.coverageStatementInvalidState()); this.$router.navigate( navigationScenarios.CLICKED_FORWARD_WITH_INVALID_STATE, this.$route, @@ -406,23 +409,23 @@ export default { }, getHeaderTextFromCms(cmsWidgetName) { const header = this.getCmsContent(cmsWidgetName, 'HeaderText'); - return this.processIfStatements(header, 'custom', this.getCustomValueFromString); + return processIfStatements(header, 'custom', this.getCustomValueFromString); }, getSubheaderTextFromCms(cmsWidgetName) { const subHeader = this.getCmsContent(cmsWidgetName, 'SubHeaderText'); - return this.processIfStatements(subHeader, 'custom', this.getCustomValueFromString); + return processIfStatements(subHeader, 'custom', this.getCustomValueFromString); }, getBodyTextFromCms(cmsWidgetName) { const bodyText = this.getCmsContent(cmsWidgetName, 'BodyText'); - return this.processIfStatements(bodyText, 'custom', this.getCustomValueFromString); + return processIfStatements(bodyText, 'custom', this.getCustomValueFromString); }, getSecondaryTextFromCms(cmsWidgetName) { const secondaryText = this.getCmsContent(cmsWidgetName, 'SecondaryText'); - return this.processIfStatements(secondaryText, 'custom', this.getCustomValueFromString); + return processIfStatements(secondaryText, 'custom', this.getCustomValueFromString); }, getExplantoryTextFromCms(cmsWidgetName) { const explanatoryText = this.getCmsContent(cmsWidgetName, 'BodyText'); - return this.processIfStatements(explanatoryText, 'custom', this.getCustomValueFromString); + return processIfStatements(explanatoryText, 'custom', this.getCustomValueFromString); }, getCustomValueFromString(str) { switch (str) {