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) {
// 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
this.$refs.loadingModal.showModal();
this.updateVehicleInfo(matchingCars.vin, matchingCars.vehicle);
navigateAfterSaveToHeritageFunnel(this.$route);
} else {
// and there is no match, navigate to "address-vehicles" page