diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue index 63b959cd..c36a9a0b 100644 --- a/src/layouts/welcome-page/welcome-page.vue +++ b/src/layouts/welcome-page/welcome-page.vue @@ -283,31 +283,33 @@ export default { }, navigateForward(policy) { - // if policy lookup is unsuccessful, navigate to policy-holder-details page - if (!policy) { + if (policy) { + if (this.vehiclesFound) { + // if policy lookup is successful and vehicles are found, navigate to policy-vehicles page + this.$router.navigate( + this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES, + this.$route, + {}, + {}, + this.vehiclesFound + ); + } + else { + // if policy lookup is successful, but no vehicles are associated with the policy + // navigate to vehicle-selection page (manual entry) + this.$router.navigate( + this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES, + this.$route + ); + } + } + else { + // if policy lookup is unsuccessful, navigate to policy-holder-details page this.$router.navigate( this.navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED, this.$route ); } - // if policy lookup is successful, but no vehicles are associated with the policy - // navigate to vehicle-selection page (manual entry) - else if (policy && !this.vehiclesFound) { - this.$router.navigate( - this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES, - this.$route - ); - } - // if policy lookup is successful and vehicles are found, navigate to policy-vehicles page - else if (policy && this.vehiclesFound) { - this.$router.navigate( - this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES, - this.$route, - {}, - {}, - this.vehiclesFound - ); - } }, getWelcomePageModelFromStore() {