diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index d04d10872..bc3682cf0 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -482,11 +482,12 @@ export default { } const loadInitialDataPromise = new Promise((resolve, reject) => { - const response = config.getSelectableDatesCallback( - initialViewStartDate, - initialViewEndDate, - config.providerNumber - ); + const response = config.getSelectableDatesCallback({ + startDateString: initialViewStartDate, + endDateString: initialViewEndDate, + providerNumber: config.providerNumber, + zipCode: config.zipCode, + }); resolve(response); }); diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 24db46594..be28b34db 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -257,7 +257,12 @@ const TIME_SLOTS_CALL_DAYS_LIMIT = 34; // needs to be 34 for API limits (35 does const NUMBER_OF_CALENDAR_ROWS_TO_SHOW_FOR_INITIAL_VIEW = 2; const MOBILE_FEE_PART_TYPE = "MOBILE FEE"; -const getScheduleApiResponse = async (startDateString, endDateString, providerNumber) => { +const getScheduleApiResponse = async ({ + startDateString, + endDateString, + providerNumber, + zipCode, +}) => { const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT); const difference = calcDaysBetweenDates(startDateString, endDateString); const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT); @@ -287,6 +292,7 @@ const getScheduleApiResponse = async (startDateString, endDateString, providerNu payload: { startDate: apiStartDate, endDate: apiEndDate, + zipCode: zipCode, }, }; storeActionConfigInshop = { @@ -762,9 +768,7 @@ export default { ); }, isAppointmentTypeDisplayed() { - // temporary adjustment - return true; - // return this.zipCode && !this.displayNoShopsAlert; + return this.zipCode && !this.displayNoShopsAlert; }, requiresInshopRecalibration() { // Specifically check for isRecalibrationServiceableMobile === false, not null or true. @@ -1207,11 +1211,12 @@ export default { }, async getMoreScheduleData(startDate, endDate) { // called only when "View more dates" is clicked; not on initial page load - const moreShopTimeSlots = await getScheduleApiResponse( - startDate, - endDate, - this.selectedProvider.providerNumber - ); + const moreShopTimeSlots = await getScheduleApiResponse({ + startDateString: startDate, + endDateString: endDate, + providerNumber: this.selectedProvider.providerNumber, + zipCode: this.zipCode, + }); // ADD API CALL RESULTS TO EXISTING DATE DATA this.selectableDatesInshop.days = this.selectableDatesInshop.days.concat( diff --git a/src/store/index.js b/src/store/index.js index 61c38997c..4a428c9e2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2101,7 +2101,7 @@ export const actions = { return globalMethods.callHttpClient(options); }, - getMobileTimeSlots(context, { payload: { startDate, endDate }, pageNameToLog }) { + getMobileTimeSlots(context, { payload: { startDate, endDate, zipCode }, pageNameToLog }) { const order = context.state.order; const vehicle = context.state.order.vehicle; const payment = context.state.order.payment; @@ -2139,7 +2139,7 @@ export const actions = { style: vehicle.style, vin: vehicle.vin ?? "", }, - zipCode: order.serviceLocation.zipCode, + zipCode: zipCode ?? order.serviceLocation.zipCode, }; let hasCalled = timeSlotCallFlags.mobile;