CASH-804 - prevent First Available Appointment Date from Resetting
This commit is contained in:
parent
34675185a0
commit
8c167a4d47
1 changed files with 35 additions and 8 deletions
|
|
@ -1072,6 +1072,11 @@ export const getters = {
|
|||
},
|
||||
};
|
||||
|
||||
const timeSlotCallFlags = {
|
||||
shop: false,
|
||||
mobile: false,
|
||||
};
|
||||
|
||||
function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
||||
return (array ?? []).map((x) => x[propertyName]).filter((x) => x);
|
||||
}
|
||||
|
|
@ -2059,20 +2064,31 @@ export const actions = {
|
|||
},
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
let hasCalled = timeSlotCallFlags.shop;
|
||||
if (!hasCalled) {
|
||||
timeSlotCallFlags.shop = true;
|
||||
}
|
||||
|
||||
const options = {
|
||||
method: endpoints.GetShopTimeSlots.method,
|
||||
endpoint: endpoints.GetShopTimeSlots.url,
|
||||
payload: payload,
|
||||
logApiCall: true,
|
||||
pageNameToLog: pageNameToLog,
|
||||
additionalSuccessEventDataHandler: (response) =>
|
||||
};
|
||||
|
||||
// Only set handler if this is the very first call in this session
|
||||
if (!hasCalled) {
|
||||
options.additionalSuccessEventDataHandler = (response) =>
|
||||
getTimeSlotsAdditionalEventData(
|
||||
response.data.provisionalTriggers,
|
||||
order.serviceLocation.zipCode,
|
||||
response.data.days?.[0]?.date,
|
||||
shopAppointmentType
|
||||
),
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
return globalMethods.callHttpClient(options);
|
||||
},
|
||||
|
||||
getMobileTimeSlots(context, { payload: { startDate, endDate }, pageNameToLog }) {
|
||||
|
|
@ -2116,19 +2132,30 @@ export const actions = {
|
|||
zipCode: order.serviceLocation.zipCode,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
let hasCalled = timeSlotCallFlags.mobile;
|
||||
if (!hasCalled) {
|
||||
timeSlotCallFlags.mobile = true;
|
||||
}
|
||||
|
||||
const options = {
|
||||
method: endpoints.GetMobileTimeSlots.method,
|
||||
endpoint: endpoints.GetMobileTimeSlots.url,
|
||||
payload: payload,
|
||||
logApiCall: true,
|
||||
pageNameToLog: pageNameToLog,
|
||||
additionalSuccessEventDataHandler: (response) =>
|
||||
};
|
||||
|
||||
// Only set handler if this is the very first call in this session
|
||||
if (!hasCalled) {
|
||||
options.additionalSuccessEventDataHandler = (response) =>
|
||||
getTimeSlotsAdditionalEventData(
|
||||
response.data.provisionalTriggers,
|
||||
order.serviceLocation.zipCode,
|
||||
response.data.days?.[0]?.date
|
||||
),
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
return globalMethods.callHttpClient(options);
|
||||
},
|
||||
|
||||
getMobilePremiumFee(context, { pageNameToLog }) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue