Merge pull request #745 from Safelite/feature/richardson/SSR-1358

update getZipCodeData to return object property needed to display message
This commit is contained in:
brich1212safe 2024-06-10 16:03:09 -04:00 committed by GitHub
commit cddfb37bc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,15 +1,17 @@
import { useMainStore } from '@/store';
export async function getZipCodeData(zipCode) {
const serviceZipValidationResponse = await useMainStore().validateZip({ zip: zipCode });
return {
containsMilitaryBase: serviceZipValidationResponse.containsMilitaryBase,
isValid: serviceZipValidationResponse.isValid,
isServiceable: serviceZipValidationResponse.isServiceable,
state: serviceZipValidationResponse.state,
zipCodeCtu: serviceZipValidationResponse.zipCodeCtu
};
return await useMainStore().validateZip({ zip: zipCode })
.then((serviceZipValidationResponse) => ({
containsMilitaryBase: serviceZipValidationResponse.containsMilitaryBase,
isValid: serviceZipValidationResponse.isValid,
isServiceable: serviceZipValidationResponse.isServiceable,
state: serviceZipValidationResponse.state,
zipCodeCtu: serviceZipValidationResponse.zipCodeCtu
}))
.catch(() => ({
isValid: false
}));
}
export async function getPricedMobileFeePart(serviceZipCode) {
@ -20,7 +22,6 @@ export async function getPricedMobileFeePart(serviceZipCode) {
// Get the Mobile Fee Part
const mobileFeePart = await useMainStore().getMobileFeePart();
if (mobileFeePart.data == null || mobileFeePart.data === '') {
return Promise.resolve(null);
}