CASH-845 update api call method structure for new zipCode param to be passed
This commit is contained in:
parent
b6178ead44
commit
fb03af0533
2 changed files with 13 additions and 7 deletions
|
|
@ -483,9 +483,12 @@ export default {
|
||||||
|
|
||||||
const loadInitialDataPromise = new Promise((resolve, reject) => {
|
const loadInitialDataPromise = new Promise((resolve, reject) => {
|
||||||
const response = config.getSelectableDatesCallback(
|
const response = config.getSelectableDatesCallback(
|
||||||
initialViewStartDate,
|
{
|
||||||
initialViewEndDate,
|
startDateString: initialViewStartDate,
|
||||||
config.providerNumber
|
endDateString: initialViewEndDate,
|
||||||
|
providerNumber: config.providerNumber,
|
||||||
|
zipCode: config.zipCode,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
resolve(response);
|
resolve(response);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ 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 NUMBER_OF_CALENDAR_ROWS_TO_SHOW_FOR_INITIAL_VIEW = 2;
|
||||||
const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
|
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 apiEndDateLimit = sumDateString(startDateString, TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||||
const difference = calcDaysBetweenDates(startDateString, endDateString);
|
const difference = calcDaysBetweenDates(startDateString, endDateString);
|
||||||
const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT);
|
const apiCallsCount = Math.ceil(difference / TIME_SLOTS_CALL_DAYS_LIMIT);
|
||||||
|
|
@ -1207,9 +1207,12 @@ export default {
|
||||||
async getMoreScheduleData(startDate, endDate) {
|
async getMoreScheduleData(startDate, endDate) {
|
||||||
// called only when "View more dates" is clicked; not on initial page load
|
// called only when "View more dates" is clicked; not on initial page load
|
||||||
const moreShopTimeSlots = await getScheduleApiResponse(
|
const moreShopTimeSlots = await getScheduleApiResponse(
|
||||||
startDate,
|
{
|
||||||
endDate,
|
startDateString: startDate,
|
||||||
this.selectedProvider.providerNumber
|
endDateString: endDate,
|
||||||
|
providerNumber: this.selectedProvider.providerNumber,
|
||||||
|
zipCode: this.zipCode,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// ADD API CALL RESULTS TO EXISTING DATE DATA
|
// ADD API CALL RESULTS TO EXISTING DATE DATA
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue