This commit is contained in:
Sneha 2023-09-26 16:46:21 +05:30
parent 9ec4c2aef5
commit 92b62768f1

View file

@ -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;