Update vehicle.vue

This commit is contained in:
Sneha 2023-09-06 19:05:34 +05:30
parent bbb1bce769
commit 726d52b100

View file

@ -121,8 +121,6 @@ export default {
makeOptions: [],
modelOptions: [],
styleOptions: [],
//flag to check getVehicle action in progress
vehicleInProgress: false,
};
},
@ -279,14 +277,13 @@ export default {
},
async selectedStyle(style) {
if (style) {
this.vehicleInProgress = true;
this.carId = null;
const result = await this.getVehicle(
this.selectedYear,
this.selectedMake,
this.selectedModel,
style
);
this.vehicleInProgress = false;
this.carId = result?.data.carId;
this.category = result?.data.category;
this.imageUrl = result?.data.imageUrl;
@ -299,12 +296,12 @@ export default {
},
computed: {
unmatchedVehicleIcon() {
if (this.imageUrl == null) return true;
if (this.imageUrl == null && this.carId !== null) return true;
else return false;
},
displayGeneric() {
if (!this.selectedStyle) return true;
else if (this.vehicleInProgress) return true;
else if (this.carId == null) return true;
else if (this.imageUrl == null && this.carId !== null) return false;
else return true;
},