diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 920cc5ff..e9ce0061 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -120,6 +120,9 @@ export default { arePagePrerequisitesValid() { return this.mainStore.order.vehicle.carId !== null; }, + loadDefaultsFromStore() { + this.customerQuestions = this.mainStore.customerData.addressQuestions.zipCode; + }, backButtonAction() { // route to move backwards this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); @@ -139,8 +142,11 @@ export default { this.resetWarningsAndErrors(); // Lookup VIN - const vinLookupResponse = useMainStore().lookupVinByPlate( - this.licensePlate, this.licenseState); + const vinLookupResponse = useMainStore().lookupVinByPlate({ + licensePlate: this.customerQuestions.licensePlate, + licenseState: this.licenseState, + }); + const registrationZipValidationResponse = useMainStore().validateZip( { zip: this.registrationZipCode }); // Settle promises and get results @@ -212,7 +218,7 @@ export default { }, }, false - );8 + ); return await this.navigateForward(); }, @@ -237,6 +243,7 @@ export default { }, mounted() { this.attachCustomEvents(); + this.loadDefaultsFromStore(); }, computed: { AlertMatchedDifferentVehicleHeader() { diff --git a/src/store/index.js b/src/store/index.js index ad14d810..7e781a20 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -128,7 +128,7 @@ export const useMainStore = defineStore({ return state.applicationUser.pageData[page]; }, customerData: (state) => { - if (state.order.vehicle.registration.address) + if (state.order.vehicle.registration.zipCode) { const registration = state.order.vehicle.registration; return { @@ -306,7 +306,7 @@ export const useMainStore = defineStore({ endpoint: endpoints.LookupVinByPlate.url, payload: { licensePlate: licensePlate, - licenseState: "IL", // hard coded until Welcome Page is complete and license state can be pulled from store + licenseState: licenseState, }, });