CASH-845: use isServiceable___ vars to selectively load mobile time-slots, inshop, or both

This commit is contained in:
AdamCaouetteSafelite 2025-07-18 01:13:39 -04:00
parent cefdb0fa70
commit d2cf736c4c

View file

@ -249,6 +249,8 @@ const getScheduleApiResponse = async ({
endDateString, endDateString,
providerNumber, providerNumber,
zipCode, zipCode,
includeMobileTimeSlots = true,
includeInshopTimeSlots = true,
}) => { }) => {
const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT); const apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT);
const difference = calcDaysBetweenDates(startDateString, endDateString); const difference = calcDaysBetweenDates(startDateString, endDateString);
@ -292,8 +294,8 @@ const getScheduleApiResponse = async ({
}, },
}; };
if (apiStartDate < apiEndDate) { if (apiStartDate < apiEndDate) {
storeActionConfigs.push(storeActionConfigInshop); if (includeInshopTimeSlots) storeActionConfigs.push(storeActionConfigInshop);
storeActionConfigs.push(storeActionConfigMobile); if (includeMobileTimeSlots) storeActionConfigs.push(storeActionConfigMobile);
} }
} }
@ -329,6 +331,8 @@ const getScheduleApiResponse = async ({
...mobileTimeSlotsData.days, ...mobileTimeSlotsData.days,
...mobileTimeSlotsResponse.data.days, ...mobileTimeSlotsResponse.data.days,
]; ];
mobileTimeSlotsData.type = mobileTimeSlotsResponse.data.type;
mobileTimeSlotsData.zipCode = mobileTimeSlotsResponse.data.zipCode;
} else { } else {
const inshopTimeSlotsResponse = const inshopTimeSlotsResponse =
await baseMixin.methods.dispatchStoreActionWithLogging( await baseMixin.methods.dispatchStoreActionWithLogging(
@ -346,6 +350,9 @@ const getScheduleApiResponse = async ({
...inshopTimeSlotsData.days, ...inshopTimeSlotsData.days,
...inshopTimeSlotsResponse.data.days, ...inshopTimeSlotsResponse.data.days,
]; ];
inshopTimeSlotsData.type = inshopTimeSlotsResponse.data.type;
inshopTimeSlotsData.providerNumber =
inshopTimeSlotsResponse.data.providerNumber;
} }
}) })
); );
@ -591,7 +598,6 @@ export default {
); );
}); });
}, },
mounted() {
async mounted() { async mounted() {
const datePickerInitialData = await datePicker.methods.loadInitialData({ const datePickerInitialData = await datePicker.methods.loadInitialData({
// setup config options for date-picker // setup config options for date-picker
@ -601,6 +607,8 @@ export default {
// preSelectedDate: preSelectedDate, // preSelectedDate: preSelectedDate,
providerNumber: this.selectedProvider?.providerNumber, providerNumber: this.selectedProvider?.providerNumber,
zipCode: this.zipCode, zipCode: this.zipCode,
includeMobileTimeSlots: this.isServiceableMobile,
includeInshopTimeSlots: this.isServiceableInshop || this.isServiceableDropoff,
}); });
datePickerInitialData.pricingByDayBasePrice = this.pricingByDayBasePrice; datePickerInitialData.pricingByDayBasePrice = this.pricingByDayBasePrice;
datePickerInitialData.pricingByDayUpcharge = this.pricingByDayUpcharge; datePickerInitialData.pricingByDayUpcharge = this.pricingByDayUpcharge;