Merge pull request #1099 from Safelite/feature/richardson/INSR-8529

dont call shop timeslots if no provider
This commit is contained in:
brich1212safe 2026-02-19 11:29:52 -05:00 committed by GitHub
commit f0fb72fe05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -171,20 +171,20 @@ const getAvailableDates = async (
await Promise.all(storeActionConfigs.map(async (storeAction) => { await Promise.all(storeActionConfigs.map(async (storeAction) => {
let timeSlotsResponse = null; let timeSlotsResponse = null;
if (storeAction.storeAction === GET_SHOP_TIME_SLOTS) { if (storeAction.storeAction === GET_SHOP_TIME_SLOTS) {
timeSlotsResponse = await useMainStore().getShopTimeSlots( if (storeAction.payload.providerNumber) {
timeSlotsResponse = await useMainStore().getShopTimeSlots(
storeAction.payload.startDate, storeAction.payload.startDate,
storeAction.payload.endDate, storeAction.payload.endDate,
storeAction.payload.shopAppointmentType, storeAction.payload.shopAppointmentType,
storeAction.payload.providerNumber storeAction.payload.providerNumber
); );
}
} else if (storeAction.payload?.zipCodeOverride) { } else if (storeAction.payload?.zipCodeOverride) {
timeSlotsResponse = await useMainStore().getMobileTimeSlots( timeSlotsResponse = await useMainStore().getMobileTimeSlots(
storeAction.payload.startDate, storeAction.payload.startDate,
storeAction.payload.endDate, storeAction.payload.endDate,
storeAction.payload.zipCodeOverride storeAction.payload.zipCodeOverride
).catch(() => { );
console.warn('Error fetching mobile time slots...');
});
} }
if (!timeSlotsResponse || !timeSlotsResponse.data) { if (!timeSlotsResponse || !timeSlotsResponse.data) {
@ -204,6 +204,9 @@ const getAvailableDates = async (
// sort days chronologically // sort days chronologically
timeSlotsResponsesData.days.sort(compareDayStrings); timeSlotsResponsesData.days.sort(compareDayStrings);
return timeSlotsResponsesData; return timeSlotsResponsesData;
})
.catch(() => {
return timeSlotsResponsesData;
}); });
}; };

View file

@ -990,7 +990,8 @@ export const useMainStore = defineStore({
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetShopTimeSlots.method, method: endpoints.GetShopTimeSlots.method,
endpoint: endpoints.GetShopTimeSlots.url, endpoint: endpoints.GetShopTimeSlots.url,
payload payload,
bailoutOnError: false
}); });
}, },
async getWipers() { async getWipers() {