Skip to content

Commit

Permalink
dynamic booking duration fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit91848 committed Dec 27, 2023
1 parent 55c9efe commit 9aa60fa
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,10 @@ export const BookEventFormChild = ({

// Ensures that duration is an allowed value, if not it defaults to the
// default eventQuery duration.
const validDuration =
duration &&
eventQuery.data.metadata?.multipleDuration &&
eventQuery.data.metadata?.multipleDuration.includes(duration)
? duration
: eventQuery.data.length;
const validDuration = eventQuery.data.isDynamic
? duration || eventQuery.data.length
: (duration && eventQuery.data.metadata?.multipleDuration?.includes(duration)) ||
eventQuery.data.length;

const bookingInput = {
values,
Expand Down

0 comments on commit 9aa60fa

Please sign in to comment.