Skip to content

Commit

Permalink
DRY up generate_conference_information
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorntonMatthew committed Nov 15, 2023
1 parent 9df614a commit 38b0e1b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/models/hearings/webex_conference_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def guest_link
def generate_conference_information
meeting_type.update!(service_name: "webex")

conference = WebexService.new(
conference_response = WebexService.new(
host: ENV["WEBEX_HOST_IC"],
port: ENV["WEBEX_PORT"],
aud: ENV["WEBEX_ORGANIZATION"],
Expand All @@ -23,11 +23,9 @@ def generate_conference_information
api_endpoint: ENV["WEBEX_API_IC"]
).create_conference(hearing_day)

base_url = conference.data["baseUrl"]

update!(
host_link: "#{base_url}#{conference.data['host'].first['short']}",
guest_hearing_link: "#{base_url}#{conference.data['guest'].first['short']}"
host_link: conference_response.host_link,
guest_hearing_link: conference_response.guest_link
)
end
end

0 comments on commit 38b0e1b

Please sign in to comment.