diff --git a/src/store/index.js b/src/store/index.js index 76866a1f..9ab28b15 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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;