Skip to content

Scheduling infrastructure for absolutely everyone.

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

Alex van Andele65116d9e35a
diff --git a/apps/web/server/routers/viewer/slots.tsx b/apps/web/server/routers/viewer/slots.tsx
index ea61e29a3e5..421124bbb7e 100644
--- a/apps/web/server/routers/viewer/slots.tsx
+++ b/apps/web/server/routers/viewer/slots.tsx
@@ -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 = {