Allows setting the event frequency to other than event length (#1349)

This commit is contained in:
Alex van Andel authored and GitHub committed 2021-12-19 12:11:31 +00:00
1 parent 38f762f7b2
commit cbf528c33e
12 files changed
+70 -4

No files matched your search

+3 -2
View File
@@ -23,6 +23,7 @@ type Slot = {
};
type UseSlotsProps = {
slotInterval: number | null;
eventLength: number;
eventTypeId: number;
minimumBookingNotice?: number;
@@ -32,7 +33,7 @@ type UseSlotsProps = {
};
export const useSlots = (props: UseSlotsProps) => {
const { eventLength, minimumBookingNotice = 0, date, users, eventTypeId } = props;
const { slotInterval, eventLength, minimumBookingNotice = 0, date, users, eventTypeId } = props;
const [slots, setSlots] = useState<Slot[]>([]);
const [loading, setLoading] = useState<boolean>(false);
const [error, setError] = useState<Error | null>(null);
@@ -102,7 +103,7 @@ export const useSlots = (props: UseSlotsProps) => {
const handleAvailableSlots = async (res: Response) => {
const responseBody: AvailabilityUserResponse = await res.json();
const times = getSlots({
frequency: eventLength,
frequency: slotInterval || eventLength,
inviteeDate: date,
workingHours: responseBody.workingHours,
minimumBookingNotice,
+1
View File
@@ -12,6 +12,7 @@ export type AdvancedOptions = {
requiresConfirmation?: boolean;
disableGuests?: boolean;
minimumBookingNotice?: number;
slotInterval?: number | null;
price?: number;
currency?: string;
schedulingType?: SchedulingType;