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

View file

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