diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 97c66c3bf..b653588b6 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -264,8 +264,24 @@ export default { model ); this.styleOptions = result?.data; - if (this.styleOptions.length === 1) this.selectedStyle = this.styleOptions[0]; - else this.selectedStyle = null; + if (this.styleOptions.length === 1) { + const sameStyle = this.selectedStyle === this.styleOptions[0]; + this.selectedStyle = this.styleOptions[0]; + if (sameStyle) { + this.carId = null; + const result = await this.getVehicle( + this.selectedYear, + this.selectedMake, + this.selectedModel, + this.selectedStyle + ); + this.carId = result?.data.carId; + this.category = result?.data.category; + this.imageUrl = result?.data.imageUrl; + this.imageVifNumber = result?.data.imageVifNumber; + this.imageVifColor = result?.data.imageVifColor; + } + } else this.selectedStyle = null; } else { this.styleOptions = []; this.selectedStyle = null;