refactor logic for policy lookup
This commit is contained in:
parent
b8a72d7f41
commit
070b9dc7d5
1 changed files with 22 additions and 20 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue