Merge pull request #1326 from Safelite/feature/CSR-1418.02

Update vehicle.vue
This commit is contained in:
AMSNEHA 2023-09-01 18:50:34 +05:30 committed by GitHub
commit ae1e94162c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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