Fix for slots being duplicated in teams (#3082)

This commit is contained in:
Alex van Andel authored and GitHub committed 2022-06-16 10:03:51 -06:00
1 parent abe090881a
commit c5a40f6c37
1 file changed
+9 -1
+9 -1
View File
@@ -100,7 +100,15 @@ const getSlots = ({ inviteeDate, frequency, minimumBookingNotice, workingHours,
slots.push(slot);
}
});
return slots;
const uniq = (a: Dayjs[]) => {
const seen: Record<string, boolean> = {};
return a.filter((item) => {
return seen.hasOwnProperty(item.format()) ? false : (seen[item.format()] = true);
});
};
return uniq(slots);
};
export default getSlots;