Update vehicle.vue

This commit is contained in:
Sneha 2023-09-01 16:47:46 +05:30
parent c214b73378
commit 76b11fb39a

View file

@ -251,7 +251,10 @@ export default {
if (make) {
const result = await this.getModelOptions(this.selectedYear, make);
this.modelOptions = result?.data;
if (this.selectedMakefromStore() !== make) {
if (
this.selectedMakefromStore() === make ||
this.selectedMakefromStore() !== make
) {
if (this.modelOptions.length === 1) this.selectedModel = this.modelOptions[0];
else this.selectedModel = null;
this.selectedStyle = null;
@ -270,7 +273,10 @@ export default {
model
);
this.styleOptions = result?.data;
if (this.selectedModelfromStore() !== model) {
if (
this.selectedModelfromStore() !== model ||
this.selectedModelfromStore() === model
) {
if (this.styleOptions.length === 1) this.selectedStyle = this.styleOptions[0];
else this.selectedStyle = null;
}