From 5a603f3b2c9d01d67e3530ebc0ea0d2ee83aeadb Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 11 Oct 2023 15:55:46 -0400 Subject: [PATCH] save endorsement questions, update navigation (cherry picked from commit f78e32a94e7e0a034032c1420b64e7ee878540a9) --- src/layouts/policy-vehicles/policy-vehicles.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 8e08bd97..021772c6 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -117,13 +117,14 @@ export default { ? vehicle?.coverages[0].deductible : 0; }, - selectedVehicleHasEndorsements() { + endorsementsForSelectedVehicle() { const vehicle = this.policyVehicles.find((policyVehicle) => policyVehicle?.vin === this.selectedVehicleVin); - if (!vehicle) { - return false; + if (vehicle?.endorsements?.length > 0) { + + return vehicle.endorsements; } - return vehicle.endorsements?.length > 0; + return []; }, repairWaivedForSelectedVehicle() { const vehicle = this.policyVehicles.find((policyVehicle) => @@ -182,7 +183,8 @@ export default { vin: this.selectedVehicleVin, noCoverage: this.noCoverageForSelectedVehicle, deductible: this.deductibleForSelectedVehicle, - repairWaived: this.repairWaivedForSelectedVehicle + repairWaived: this.repairWaivedForSelectedVehicle, + endorsements: this.endorsementsForSelectedVehicle }); useMainStore().updateVehicle(this.vehicleFromLookup); @@ -205,7 +207,7 @@ export default { {}, {} ); - } else if (this.selectedVehicleHasEndorsements) { + } else if (this.endorsementsForSelectedVehicle?.length > 0) { this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD_WITH_ENDORSEMENTS, this.$route