Fixed issue affecting people with multiple workingHours in single schedule (#3077)

This commit is contained in:
Alex van Andel authored and GitHub committed 2022-06-16 11:40:36 +01:00
1 parent f82404392f
commit e65116d9e3
1 file changed
+2 -1
+2 -1
View File
@@ -55,7 +55,7 @@ const checkForAvailability = ({
currentSeats?: CurrentSeats;
}) => {
if (
!workingHours.every((workingHour) => {
!workingHours.some((workingHour) => {
if (!workingHour.days.includes(time.day())) {
return false;
}
@@ -193,6 +193,7 @@ export const slotsRouter = createRouter().query("getSchedule", {
};
})
);
const workingHours = userSchedules.flatMap((s) => s.workingHours);
const slots: Record<string, Slot[]> = {};
const availabilityCheckProps = {