diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index f779b11cf..c572c4f69 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -7,6 +7,9 @@ const storeMutations = { UPDATE_STYLE: "updateStyle", UPDATE_CAR_ID: "updateCarId", UPDATE_VEHICLE_CATEGORY: "updateVehicleCategory", + UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl", + UPDATE_VEHICLE_IMAGE_VIF_NUMBER: "updateVehicleImageVifNumber", + UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor", // EVENT BUS MUTATIONS ADD_EVENT_TO_BUS: "addEventToBus", diff --git a/src/store/index.js b/src/store/index.js index b4177f8d8..c7227de47 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -52,6 +52,15 @@ export const mutations = { updateVehicleCategory(state, category) { state.order.vehicle.category = category; }, + updateVehicleImageUrl(state, imageUrl) { + state.order.vehicle.imageUrl = imageUrl; + }, + updateVehicleImageVifNumber(state, imageVifNumber) { + state.order.vehicle.imageVifNumber = imageVifNumber; + }, + updateVehicleImageColor(state, imageColor) { + state.order.vehicle.imageColor = imageColor; + }, // EVENT BUS MUTATIONS addEventToBus(state, event) { @@ -168,6 +177,9 @@ export const actions = { .then((response) => { context.commit(storeMutations.UPDATE_CAR_ID, response.data.carId); context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, response.data.category); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, response.data.imageUrl); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, response.data.imageVifNumber); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, response.data.imageVifColor); return response; }); },