Merge pull request #356 from Safelite/feature/digital/SSR-386
do not handle error if vehicle lookup is successful
This commit is contained in:
commit
d777fd9457
1 changed files with 18 additions and 18 deletions
|
|
@ -193,12 +193,12 @@ export default {
|
||||||
const vehicle = await this.lookupVehicleByVin(value);
|
const vehicle = await this.lookupVehicleByVin(value);
|
||||||
|
|
||||||
// handle error in case vehicle info doesn't come back for selected VIN
|
// handle error in case vehicle info doesn't come back for selected VIN
|
||||||
if (vehicle?.error ?? true) {
|
if (vehicle?.error === true) {
|
||||||
this.mainStore.resetVehicleState();
|
this.mainStore.resetVehicleState();
|
||||||
this.displayGeneric = true;
|
this.displayGeneric = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (vehicle) {
|
||||||
// save selected vehicle to the store
|
// save selected vehicle to the store
|
||||||
this.mainStore.updateVehicle(vehicle.data);
|
this.mainStore.updateVehicle(vehicle.data);
|
||||||
this.displayGeneric = true;
|
this.displayGeneric = true;
|
||||||
|
|
@ -207,13 +207,13 @@ export default {
|
||||||
const styleOptions = await this.mainStore.getVehicleStyles(
|
const styleOptions = await this.mainStore.getVehicleStyles(
|
||||||
vehicle.data.year,
|
vehicle.data.year,
|
||||||
vehicle.data.make,
|
vehicle.data.make,
|
||||||
vehicle.data.model
|
vehicle.data.model,
|
||||||
)
|
);
|
||||||
|
|
||||||
// if there is more than 1 style for the selected vehicle, display generic/blurred image
|
// if there is more than 1 style for the selected vehicle, display generic/blurred image
|
||||||
this.displayGeneric = styleOptions?.data?.length > 1;
|
this.displayGeneric = styleOptions?.data?.length > 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
siteHeader,
|
siteHeader,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue