dont call shop timeslots if no provider

This commit is contained in:
Bill Richardson 2026-02-19 11:16:40 -05:00
parent df4ff56497
commit 14b1221c11
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() {