SSR-1348 Don't overwrite vin for same vehicle

This commit is contained in:
Josh Dassinger 2024-06-28 10:36:28 -05:00
parent a6e124bd3f
commit 3814ccef51

View file

@ -1738,8 +1738,14 @@ export const useMainStore = defineStore({
},
updateVehicle(vehicle) {
// Assuming that the method caller pass all the properties.
// otherwise need to check for undefined for every property.
// Assuming that the method caller pass all the properties.
// otherwise need to check for undefined for every property.
if (this.order.vehicle.carId !== vehicle.carId
|| (!this.order.vehicle.vin && vehicle.vin)
|| (this.order.vehicle.vin && vehicle.vin && this.order.vehicle.vin !== vehicle.vin)) {
this.order.vehicle.vin = vehicle.vin;
}
this.order.vehicle.policyVehicleId = vehicle.policyVehicleId;
this.order.vehicle.carId = vehicle.carId;
this.order.vehicle.category = vehicle.category;
@ -1747,7 +1753,6 @@ export const useMainStore = defineStore({
this.order.vehicle.make = vehicle.make;
this.order.vehicle.model = vehicle.model;
this.order.vehicle.style = vehicle.style;
this.order.vehicle.vin = vehicle.vin;
this.order.vehicle.imageUrl = vehicle.imageUrl;
this.order.vehicle.imageVifNumber = vehicle.imageVifNumber;
this.order.vehicle.imageColor = vehicle.imageVifColor;