updated to clear other areas of the vehicle when previous areas are changed

This commit is contained in:
Jason Wheeler 2022-11-11 11:53:08 -05:00
parent 7789d19fbf
commit b0d91b0224
4 changed files with 19 additions and 5 deletions

View file

@ -90,7 +90,10 @@
},
watch: {
selectedMake(make) {
this.mainStore.updateVehicleMake(make);
if(make != this.mainStore.order.vehicle.make)
{
this.mainStore.updateVehicle({make, model: null, style: null});
}
this.$router.navigate(
this.navigationScenarios.SELECTED_MAKE,
this.$route

View file

@ -83,7 +83,10 @@
watch: {
selectedModel(model) {
this.mainStore.updateVehicleModel(model);
if(model != this.mainStore.order.vehicle.model)
{
this.mainStore.updateVehicle({model, style: null});
}
this.$router.navigate(
this.navigationScenarios.SELECTED_MODEL,
this.$route

View file

@ -77,8 +77,12 @@ export default {
watch: {
selectedStyle(style) {
this.mainStore.updateVehicle({style})
this.mainStore.setVehicle(style).then(() => {
if(style != this.mainStore.order.vehicle.style)
{
this.mainStore.updateVehicle({style});
}
this.mainStore.setVehicle().then(() => {
this.$router.navigate(
this.navigationScenarios.SELECTED_STYLE,
this.$route

View file

@ -69,7 +69,11 @@
watch: {
selectedYear(year) {
const parsedYear = parseInt(year);
this.mainStore.updateVehicleYear(parsedYear);
if(parsedYear != this.mainStore.order.vehicle.year)
{
this.mainStore.updateVehicle({year: parsedYear, make: null, model: null, style: null});
}
this.$router.navigate(
this.navigationScenarios.SELECTED_YEAR,
this.$route