Merge pull request #1825 from Safelite/feature/CSR-2074

CSR-2074
This commit is contained in:
CarlNation 2024-04-15 10:52:34 -04:00 committed by GitHub
commit 46862f2e7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,6 +93,7 @@ import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-que
import alert from "@/ux-components/alert/alert";
// Supporting files
import { skipVinLookup } from "@/helpers/heritage-integration/navigation-helper";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper";
import { storeActions } from "@/constants/store-actions";
@ -365,7 +366,7 @@ export default {
return this.navigateForward();
},
navigateForward() {
async navigateForward() {
const payment = this.$store.getters.payment;
const policy = this.$store.getters.policy;
@ -376,17 +377,27 @@ export default {
policy.policyNumber !== "";
if (vehicleChangedDuringPolicyLookupInHeritage) {
if (store.getters.damage.isRepair) {
const skipVin = await skipVinLookup();
if (skipVin) {
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE,
this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN,
this.$route
);
} else {
this.$router.navigateWithSaving(
this.navigationScenarios
.CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE,
this.$route
);
if (store.getters.damage.isRepair) {
this.$router.navigateWithSaving(
this.navigationScenarios
.CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE,
this.$route
);
} else {
this.$router.navigateWithSaving(
this.navigationScenarios
.CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE,
this.$route
);
}
}
}
// If vin already exists, navigate directly to vin-lookup