CSR-583 Save vin when there's a match in address with multiple vehicles

This commit is contained in:
Katie 2022-05-16 12:32:25 -04:00
parent fe63650872
commit e401129dcf

View file

@ -286,9 +286,11 @@ export default {
} }
} else if (carsFound.length > 1) { } else if (carsFound.length > 1) {
// if multiple cars were found // if multiple cars were found
if (carsFound.find(car => car.vehicle.carId === carEntered.carId)) { const matchingCars = carsFound.find(car => car.vehicle.carId === carEntered.carId);
if (matchingCars) {
// and one of them matches the car id entered // and one of them matches the car id entered
this.$refs.loadingModal.showModal(); this.$refs.loadingModal.showModal();
this.updateVehicleInfo(matchingCars.vin, matchingCars.vehicle);
navigateAfterSaveToHeritageFunnel(this.$route); navigateAfterSaveToHeritageFunnel(this.$route);
} else { } else {
// and there is no match, navigate to "address-vehicles" page // and there is no match, navigate to "address-vehicles" page