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:
commit
cddfb37bc2
1 changed files with 11 additions and 10 deletions
|
|
@ -1,15 +1,17 @@
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
|
|
||||||
export async function getZipCodeData(zipCode) {
|
export async function getZipCodeData(zipCode) {
|
||||||
const serviceZipValidationResponse = await useMainStore().validateZip({ zip: zipCode });
|
return await useMainStore().validateZip({ zip: zipCode })
|
||||||
|
.then((serviceZipValidationResponse) => ({
|
||||||
return {
|
containsMilitaryBase: serviceZipValidationResponse.containsMilitaryBase,
|
||||||
containsMilitaryBase: serviceZipValidationResponse.containsMilitaryBase,
|
isValid: serviceZipValidationResponse.isValid,
|
||||||
isValid: serviceZipValidationResponse.isValid,
|
isServiceable: serviceZipValidationResponse.isServiceable,
|
||||||
isServiceable: serviceZipValidationResponse.isServiceable,
|
state: serviceZipValidationResponse.state,
|
||||||
state: serviceZipValidationResponse.state,
|
zipCodeCtu: serviceZipValidationResponse.zipCodeCtu
|
||||||
zipCodeCtu: serviceZipValidationResponse.zipCodeCtu
|
}))
|
||||||
};
|
.catch(() => ({
|
||||||
|
isValid: false
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getPricedMobileFeePart(serviceZipCode) {
|
export async function getPricedMobileFeePart(serviceZipCode) {
|
||||||
|
|
@ -20,7 +22,6 @@ export async function getPricedMobileFeePart(serviceZipCode) {
|
||||||
// Get the Mobile Fee Part
|
// Get the Mobile Fee Part
|
||||||
const mobileFeePart = await useMainStore().getMobileFeePart();
|
const mobileFeePart = await useMainStore().getMobileFeePart();
|
||||||
|
|
||||||
|
|
||||||
if (mobileFeePart.data == null || mobileFeePart.data === '') {
|
if (mobileFeePart.data == null || mobileFeePart.data === '') {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue