Merge pull request #777 from Safelite/defect/digital/SSR-1348

SSR-1348 Don't overwrite vin for same vehicle
This commit is contained in:
Josh Dassinger 2024-07-01 07:20:41 -05:00 committed by GitHub
commit 1cae398344
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;