From 76b11fb39a5680fd639b89842be61dcc008f6b89 Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 1 Sep 2023 16:47:46 +0530 Subject: [PATCH 1/3] Update vehicle.vue --- src/layouts/vehicle/vehicle.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 28900033b..c8c404b47 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -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; } From 7750511ecffe1b138c62233922651363bdee0194 Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 1 Sep 2023 17:30:09 +0530 Subject: [PATCH 2/3] Update vehicle.vue --- src/layouts/vehicle/vehicle.vue | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index c8c404b47..7d9b7dffa 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -251,14 +251,9 @@ export default { if (make) { const result = await this.getModelOptions(this.selectedYear, make); this.modelOptions = result?.data; - if ( - this.selectedMakefromStore() === make || - this.selectedMakefromStore() !== make - ) { - if (this.modelOptions.length === 1) this.selectedModel = this.modelOptions[0]; - else this.selectedModel = null; - this.selectedStyle = null; - } + if (this.modelOptions.length === 1) this.selectedModel = this.modelOptions[0]; + else this.selectedModel = null; + this.selectedStyle = null; } else { this.modelOptions = []; this.selectedModel = null; @@ -273,13 +268,8 @@ export default { model ); this.styleOptions = result?.data; - if ( - this.selectedModelfromStore() !== model || - this.selectedModelfromStore() === model - ) { - if (this.styleOptions.length === 1) this.selectedStyle = this.styleOptions[0]; - else this.selectedStyle = null; - } + if (this.styleOptions.length === 1) this.selectedStyle = this.styleOptions[0]; + else this.selectedStyle = null; } else { this.styleOptions = []; this.selectedStyle = null; From 868f7d34372ac4db7ff664c68be4626a5f36f50e Mon Sep 17 00:00:00 2001 From: Sneha Date: Fri, 1 Sep 2023 17:52:07 +0530 Subject: [PATCH 3/3] Update vehicle.vue --- src/layouts/vehicle/vehicle.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 7d9b7dffa..90beead0c 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -252,8 +252,10 @@ export default { const result = await this.getModelOptions(this.selectedYear, make); this.modelOptions = result?.data; if (this.modelOptions.length === 1) this.selectedModel = this.modelOptions[0]; - else this.selectedModel = null; - this.selectedStyle = null; + else { + this.selectedModel = null; + this.selectedStyle = null; + } } else { this.modelOptions = []; this.selectedModel = null;