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';
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue