Skip to content

Commit

Permalink
Only parse RTS query slots when they are set as options
Browse files Browse the repository at this point in the history
  • Loading branch information
CronofyMatt committed Jul 27, 2023
1 parent 27fa83a commit ff2b35d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/cronofy/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,9 @@ def add_to_calendar(args = {})
# call
# :required_duration - A hash stating the length of time the event will
# last for
# :query_periods - A hash stating the available periods for the event
# :query_periods - A Hash stating the available periods for the event
# :query_slots - A Hash containing the query slots to be
# used in the availability query.
# :start_interval - An Integer representing the start interval
# of minutes for the availability query.
# :buffer - An Hash containing the buffer to apply to
Expand Down Expand Up @@ -1137,7 +1139,14 @@ def real_time_scheduling(args = {})
end
end

translate_available_periods(availability[:query_periods] || availability[:available_periods])
if query_periods = availability[:query_periods] || availability[:available_periods]
translate_available_periods(query_periods)
end

if query_slots = availability[:query_slots]
translate_query_slots(query_slots)
end

body[:availability] = availability

response = raw_post("/v1/real_time_scheduling", body)
Expand Down

0 comments on commit ff2b35d

Please sign in to comment.