Merge pull request #1360 from Safelite/feature/CSR-1665

Add logging to resetScheduleIfUnavailable
This commit is contained in:
CarlNation 2023-09-26 13:10:48 -04:00 committed by GitHub
commit 36c95dd826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1654,7 +1654,7 @@ export const actions = {
response.data
);
await resetScheduleIfUnavailable(context, response.data.order);
await resetScheduleIfUnavailable(context, response.data.order, pageNameToLog);
return response;
},
(error) => {
@ -2309,7 +2309,7 @@ function providersEqual(providerA, providerB) {
// check to see if we have an appointment date on the order object.
// if so, make sure it's not in the past. if in the past, clear schedule info in store.
// if date not in past, then call schedule service to verify appointment is still available.
async function resetScheduleIfUnavailable(context, order) {
async function resetScheduleIfUnavailable(context, order, pageNameToLog) {
if (!order.schedule?.date) {
return;
}
@ -2348,8 +2348,11 @@ async function resetScheduleIfUnavailable(context, order) {
newTimeSlotsResponse = await context.dispatch(
storeActions.GET_MOBILE_TIME_SLOTS,
{
startDate: order.schedule.date,
endDate: endDate,
payload: {
startDate: order.schedule.date,
endDate: endDate,
},
pageNameToLog: pageNameToLog,
},
false
);
@ -2391,10 +2394,13 @@ async function resetScheduleIfUnavailable(context, order) {
newTimeSlotsResponse = await context.dispatch(
storeActions.GET_SHOP_TIME_SLOTS,
{
startDate: order.schedule.date,
endDate: endDate,
shopAppointmentType: order.serviceLocation.appointmentType,
providerNumber: order.serviceLocation.provider.providerNumber,
payload: {
startDate: order.schedule.date,
endDate: endDate,
shopAppointmentType: order.serviceLocation.appointmentType,
providerNumber: order.serviceLocation.provider.providerNumber,
},
pageNameToLog: pageNameToLog,
},
false
);