Merge pull request #2697 from Safelite/feature/CASH-1229-update
Set serviceability details for ZIP when zip is changed
This commit is contained in:
commit
39f92ad9a4
2 changed files with 12 additions and 4 deletions
|
|
@ -110,6 +110,7 @@
|
||||||
:selectedProviderNumberFromParent="selectedProvider?.providerNumber"
|
:selectedProviderNumberFromParent="selectedProvider?.providerNumber"
|
||||||
:shopProviderDataFromParent="shopProviderData"
|
:shopProviderDataFromParent="shopProviderData"
|
||||||
@shop-selected="onShopSelected"
|
@shop-selected="onShopSelected"
|
||||||
|
@updated-serviceability="setServiceabilityDetails"
|
||||||
:zipCodeFromParent="zipCode"
|
:zipCodeFromParent="zipCode"
|
||||||
cmsWidgetName="YourSafeliteShopWidget" />
|
cmsWidgetName="YourSafeliteShopWidget" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -307,10 +307,6 @@ export default {
|
||||||
// I think we should call our new pushGA Event here with new mapped data
|
// I think we should call our new pushGA Event here with new mapped data
|
||||||
},
|
},
|
||||||
async setZipCodeAndShop() {
|
async setZipCodeAndShop() {
|
||||||
const selectedProvider = this.shopProviders.find(
|
|
||||||
(provider) => provider.providerNumber == this.localSelectedProviderNumber
|
|
||||||
);
|
|
||||||
|
|
||||||
const shopQuestionPopUpData = {
|
const shopQuestionPopUpData = {
|
||||||
zipCodeData: this.zipCodeData,
|
zipCodeData: this.zipCodeData,
|
||||||
shopProviderData: this.localShopProviderData,
|
shopProviderData: this.localShopProviderData,
|
||||||
|
|
@ -318,6 +314,17 @@ export default {
|
||||||
};
|
};
|
||||||
this.$emit("shop-selected", shopQuestionPopUpData);
|
this.$emit("shop-selected", shopQuestionPopUpData);
|
||||||
|
|
||||||
|
if (this.zipCodeData) {
|
||||||
|
// retrieve serviceability details
|
||||||
|
const serviceabilityDetails = await getServiceabilityDetails(
|
||||||
|
this.zipCodeData.zipCode,
|
||||||
|
null,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
|
||||||
|
this.$emit("updated-serviceability", serviceabilityDetails.data);
|
||||||
|
}
|
||||||
|
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue