lastSearchedZip removed
This commit is contained in:
parent
12c3cabb25
commit
d41afdcee1
1 changed files with 3 additions and 9 deletions
|
|
@ -117,7 +117,6 @@ export default {
|
||||||
shopIndex: 0,
|
shopIndex: 0,
|
||||||
localShopProviderData: this.shopProviderData, // Why does parent manage this sometimes, but not all of the time
|
localShopProviderData: this.shopProviderData, // Why does parent manage this sometimes, but not all of the time
|
||||||
selectedProviderNumber: null, // Revisit this, maybe not too hard
|
selectedProviderNumber: null, // Revisit this, maybe not too hard
|
||||||
lastSearchedZip: "", // zip refactor
|
|
||||||
lastSuccessfulZip: "", // zip refactor
|
lastSuccessfulZip: "", // zip refactor
|
||||||
displayInvalidZipAlert: false, // part of big refactor of asyn calls
|
displayInvalidZipAlert: false, // part of big refactor of asyn calls
|
||||||
displayNoShopsAlert: false, // part of big refactor of asyn calls
|
displayNoShopsAlert: false, // part of big refactor of asyn calls
|
||||||
|
|
@ -298,7 +297,6 @@ export default {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
this.resetsOnZipInput();
|
this.resetsOnZipInput();
|
||||||
this.displayNoShopsAlert = false;
|
|
||||||
const zipCodeData = await this.getZipCodeData(
|
const zipCodeData = await this.getZipCodeData(
|
||||||
this.newZipCode,
|
this.newZipCode,
|
||||||
"service-location"
|
"service-location"
|
||||||
|
|
@ -323,9 +321,7 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getShopProviderData(this.newZipCode).then(async (result) => {
|
getShopProviderData(this.newZipCode).then(async (result) => {
|
||||||
if (this.displayNoShopsAlert === true) {
|
|
||||||
this.displayNoShopsAlert = false;
|
this.displayNoShopsAlert = false;
|
||||||
}
|
|
||||||
this.localShopProviderData = result.data;
|
this.localShopProviderData = result.data;
|
||||||
this.updateShopsForZip(this.newZipCode);
|
this.updateShopsForZip(this.newZipCode);
|
||||||
this.selectedProvider = new Provider();
|
this.selectedProvider = new Provider();
|
||||||
|
|
@ -334,7 +330,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateShopsForZip(zipCode) {
|
updateShopsForZip(zipCode) {
|
||||||
this.lastSearchedZip = zipCode;
|
|
||||||
if (!zipCode) {
|
if (!zipCode) {
|
||||||
this.answers = [];
|
this.answers = [];
|
||||||
return;
|
return;
|
||||||
|
|
@ -421,14 +416,13 @@ export default {
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const zipToEmit = this.lastSearchedZip;
|
|
||||||
|
|
||||||
const selectedProvider = this.shopProviders.find(
|
const selectedProvider = this.shopProviders.find(
|
||||||
(provider) => provider.providerNumber == this.selectedProviderNumber
|
(provider) => provider.providerNumber == this.selectedProviderNumber
|
||||||
);
|
);
|
||||||
this.resetAlerts();
|
this.resetAlerts();
|
||||||
|
|
||||||
const zipCodeData = await this.getZipCodeData(zipToEmit, "service-location");
|
const zipCodeData = await this.getZipCodeData(this.newZipCode, "service-location");
|
||||||
|
|
||||||
if (!zipCodeData.isValid) {
|
if (!zipCodeData.isValid) {
|
||||||
this.displayInvalidZipAlert = true;
|
this.displayInvalidZipAlert = true;
|
||||||
|
|
@ -486,7 +480,7 @@ export default {
|
||||||
this.$emit("shop-selected", {
|
this.$emit("shop-selected", {
|
||||||
providerNumber: selectedProvider?.providerNumber,
|
providerNumber: selectedProvider?.providerNumber,
|
||||||
address: selectedProvider?.address,
|
address: selectedProvider?.address,
|
||||||
searchedZip: zipToEmit,
|
searchedZip: this.newZipCode,
|
||||||
searchedState: zipCodeData.state,
|
searchedState: zipCodeData.state,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue