GRN-59: Implemented pagination on the API call (#370)

* Added the env variable and functionality to paginate the call to the bbbapi

* Update user.rb
This commit is contained in:
farhatahmad
2019-03-12 13:50:20 -04:00
committed by Jesus Federico
parent ab6655554c
commit 3195bb4429
12 changed files with 278 additions and 124 deletions

View File

@ -17,6 +17,8 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
class RoomsController < ApplicationController
include RecordingsHelper
before_action :validate_accepted_terms, unless: -> { !Rails.configuration.terms }
before_action :validate_verified_email, except: [:show, :join],
unless: -> { !Rails.configuration.enable_email_verification }
@ -24,9 +26,6 @@ class RoomsController < ApplicationController
before_action :verify_room_ownership, except: [:create, :show, :join, :logout]
before_action :verify_room_owner_verified, only: [:show, :join]
include RecordingsHelper
META_LISTED = "gl-listed"
# POST /
def create
redirect_to(root_path) && return unless current_user
@ -52,10 +51,7 @@ class RoomsController < ApplicationController
def show
if current_user && @room.owned_by?(current_user)
recs = @room.recordings
# Add the room id to each recording object
recs.each do |rec|
rec[:room_uid] = @room.uid
end
@recordings = recs
@is_running = @room.running?
else
@ -168,26 +164,6 @@ class RoomsController < ApplicationController
redirect_to @room
end
# POST /:room_uid/:record_id
def update_recording
meta = {
"meta_#{META_LISTED}" => (params[:state] == "public"),
}
res = @room.update_recording(params[:record_id], meta)
# Redirects to the page that made the initial request
redirect_to request.referrer if res[:updated]
end
# DELETE /:room_uid/:record_id
def delete_recording
@room.delete_recording(params[:record_id])
# Redirects to the page that made the initial request
redirect_to request.referrer
end
private
def update_room_attributes(update_type)