CASH-276 persist canSafeliteService field
This commit is contained in:
CarlNation 2025-03-18 03:55:00 -04:00
parent 1274ee201a
commit b9f14fdb2d
3 changed files with 16 additions and 1 deletions

View file

@ -17,6 +17,7 @@ const storeMutations = {
UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor",
UPDATE_VEHICLE_VIN: "updateVehicleVin",
UPDATE_VEHICLE: "updateVehicle",
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
UPDATE_IS_REPAIR: "updateIsRepair",
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",

View file

@ -140,7 +140,7 @@ export default {
modelOptions: [],
styleOptions: [],
displayNoServiceAlert: false,
canSafeliteService: false,
canSafeliteService: this.canSafeliteServiceFromStore(),
};
},
@ -316,6 +316,9 @@ export default {
},
watch: {
serviceZipCode(newValue, oldValue) {
this.resetAlert();
},
async selectedYear(year) {
this.resetAlert();
this.makeOptions = [];
@ -323,6 +326,7 @@ export default {
this.selectedModel = null;
this.selectedStyle = null;
this.vehicleSubType = null;
this.canSafeliteService = false;
this.carId = null;
if (year) {
const result = await this.getMakeOptions(year);
@ -496,6 +500,7 @@ export default {
vehicleSubType: this.vehicleSubType,
carId: this.carId,
category: this.category,
canSafeliteService: this.canSafeliteService,
imageUrl: this.imageUrl,
imageVifNumber: this.imageVifNumber,
imageVifColor: this.imageVifColor,
@ -553,6 +558,9 @@ export default {
selectedStylefromStore() {
return store.getters.externalParameterVehicle.style ?? store.getters.vehicle.style;
},
canSafeliteServiceFromStore() {
return store.getters.vehicle.canSafeliteService ?? false;
},
async getMakeOptions(year) {
return await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_VEHICLE_MAKES,

View file

@ -65,6 +65,7 @@ const getDefaultState = () => {
carId: null,
category: null,
vin: null,
canSafeliteService: null,
imageUrl: null,
imageVifNumber: null,
imageColor: null,
@ -221,6 +222,9 @@ export const mutations = {
updateVehicleCategory(state, category) {
state.order.vehicle.category = category;
},
updateVehicleCanSafeliteService(state, canSafeliteService) {
state.order.vehicle.canSafeliteService = canSafeliteService;
},
updateVehicleImageUrl(state, imageUrl) {
state.order.vehicle.imageUrl = imageUrl;
},
@ -2357,6 +2361,7 @@ export const actions = {
vehicleSubType,
carId,
category,
canSafeliteService,
imageUrl,
imageVifNumber,
imageVifColor,
@ -2379,6 +2384,7 @@ export const actions = {
context.commit(storeMutations.UPDATE_VEHICLE_SUBTYPE, vehicleSubType);
context.commit(storeMutations.UPDATE_CAR_ID, carId);
context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category);
context.commit(storeMutations.UPDATE_VEHICLE_CAN_SAFELITE_SERVICE, canSafeliteService);
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl);
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber);
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);