Update index.js
Changes for save vehicle method
This commit is contained in:
parent
267264e0b7
commit
ee3163549b
1 changed files with 8 additions and 18 deletions
|
|
@ -1675,35 +1675,25 @@ export const actions = {
|
|||
context,
|
||||
{ year, make, model, style, carId, category, imageUrl, imageVifNumber, imageVifColor }
|
||||
) {
|
||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||
|
||||
if (
|
||||
context.state.order.vehicle.year != year ||
|
||||
context.state.order.vehicle.make != make ||
|
||||
context.state.order.vehicle.model != model ||
|
||||
context.state.order.vehicle.style != style
|
||||
)
|
||||
) {
|
||||
context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
||||
context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES);
|
||||
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
||||
|
||||
if (context.state.order.vehicle.year != year) {
|
||||
context.commit(storeMutations.UPDATE_YEAR, year);
|
||||
}
|
||||
if (context.state.order.vehicle.make != make) {
|
||||
context.commit(storeMutations.UPDATE_MAKE, make);
|
||||
}
|
||||
if (context.state.order.vehicle.model != model) {
|
||||
context.commit(storeMutations.UPDATE_MODEL, model);
|
||||
}
|
||||
if (context.state.order.vehicle.style != style) {
|
||||
context.commit(storeMutations.UPDATE_STYLE, style);
|
||||
context.commit(storeMutations.UPDATE_CAR_ID, carId);
|
||||
context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category);
|
||||
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);
|
||||
}
|
||||
|
||||
context.commit(storeMutations.UPDATE_CAR_ID, carId);
|
||||
context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category);
|
||||
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);
|
||||
},
|
||||
|
||||
saveVehicleDamage(
|
||||
|
|
|
|||
Loading…
Reference in a new issue