Merge pull request #2630 from Safelite/feature/CASH-845-stage-3
Feature/cash 845 stage 3
This commit is contained in:
commit
749c5cc466
3 changed files with 22 additions and 16 deletions
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
@ -761,9 +767,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.
|
||||
|
|
@ -1206,11 +1210,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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue