forked from External/greenlight
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:
committed by
Jesus Federico
parent
ab6655554c
commit
3195bb4429
@ -17,11 +17,11 @@
|
||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class UsersController < ApplicationController
|
||||
include RecordingsHelper
|
||||
|
||||
before_action :find_user, only: [:edit, :update, :destroy]
|
||||
before_action :ensure_unauthenticated, only: [:new, :create]
|
||||
|
||||
include RecordingsHelper
|
||||
|
||||
# POST /u
|
||||
def create
|
||||
# Verify that GreenLight is configured to allow user signup.
|
||||
@ -135,19 +135,7 @@ class UsersController < ApplicationController
|
||||
# GET /u/:user_uid/recordings
|
||||
def recordings
|
||||
if current_user && current_user.uid == params[:user_uid]
|
||||
@recordings = []
|
||||
current_user.rooms.each do |room|
|
||||
# Check that current user is the room owner
|
||||
next unless room.owner == current_user
|
||||
|
||||
recs = room.recordings
|
||||
# Add the room id to each recording object
|
||||
recs.each do |rec|
|
||||
rec[:room_uid] = room.uid
|
||||
end
|
||||
# Adds an array to another array
|
||||
@recordings.push(*recs)
|
||||
end
|
||||
@recordings = current_user.all_recordings
|
||||
else
|
||||
redirect_to root_path
|
||||
end
|
||||
|
Reference in New Issue
Block a user