From f8766cac89463d198914161b3ace9e16e4d529de Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Tue, 10 Jan 2023 17:05:31 -0500 Subject: [PATCH 1/2] Add updateVehicleVin action Might be used in license-plate-lookup and/or address-lookup as well. It is used in vin-lookup page. --- src/store/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 90065277..9f3c1e3b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -365,6 +365,10 @@ export const useMainStore = defineStore({ this.order.vehicle.imageColor = vehicle.imageColor; }, + updateVehicleVin(vin) { + this.order.vehicle.vin = vin; + }, + resetVehicleState() { this.order.vehicle.year = null; From 43fa1c7270d43c0a79443475a0d9959c60585d60 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Tue, 10 Jan 2023 20:41:05 -0500 Subject: [PATCH 2/2] Add more properties to be updated --- src/store/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 9f3c1e3b..25ecd268 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -358,11 +358,19 @@ export const useMainStore = defineStore({ }, updateVehicle(vehicle) { + // Assuming that the method caller pass all the properties. + // otherwise need to check for undefined for every property. + this.order.vehicle.carId = vehicle.carId; this.order.vehicle.category = vehicle.category; + this.order.vehicle.year = vehicle.year; + 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.imageColor; + this.order.vehicle.imageColor = vehicle.imageVifColor; }, updateVehicleVin(vin) {