dont call shop timeslots if no provider
This commit is contained in:
parent
df4ff56497
commit
14b1221c11
2 changed files with 10 additions and 6 deletions
|
|
@ -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;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue