From 957418748d5e60a31c9569e373bf2cb90564b987 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 26 May 2022 15:42:45 -0400 Subject: [PATCH] rooms and room sets not paginated allow paging of not paginated if wanted by client --- app/controllers/concerns/resource_methods.rb | 2 +- app/controllers/room_sets_controller.rb | 4 ++++ app/controllers/rooms_controller.rb | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/resource_methods.rb b/app/controllers/concerns/resource_methods.rb index 51c639cc8..a558b5253 100644 --- a/app/controllers/concerns/resource_methods.rb +++ b/app/controllers/concerns/resource_methods.rb @@ -692,7 +692,7 @@ def paginated format = params[:format] return false if format == 'xls' || format == 'xlsx' - paginate + params[:perPage]&.to_i || paginate end def derived_col?(col_name:) diff --git a/app/controllers/room_sets_controller.rb b/app/controllers/room_sets_controller.rb index 60ceb6f66..5b8721b81 100644 --- a/app/controllers/room_sets_controller.rb +++ b/app/controllers/room_sets_controller.rb @@ -2,4 +2,8 @@ class RoomSetsController < ResourceController SERIALIZER_CLASS = 'RoomSetSerializer'.freeze POLICY_CLASS = 'RoomSetsPolicy'.freeze POLICY_SCOPE_CLASS = 'RoomSetsPolicy::Scope'.freeze + + def paginate + false + end end diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 19ed3eddc..810ab0798 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -3,4 +3,8 @@ class RoomsController < ResourceController POLICY_CLASS = 'RoomPolicy'.freeze POLICY_SCOPE_CLASS = 'RoomPolicy::Scope'.freeze DEFAULT_SORTBY = 'rooms.sort_order' + + def paginate + false + end end