diff --git a/backend/app/controllers/material_versions_controller.rb b/backend/app/controllers/material_versions_controller.rb index 9ee5ff1..5f68b48 100644 --- a/backend/app/controllers/material_versions_controller.rb +++ b/backend/app/controllers/material_versions_controller.rb @@ -5,6 +5,7 @@ class MaterialVersionsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/materials_controller.rb b/backend/app/controllers/materials_controller.rb index 93b2fbe..46df777 100644 --- a/backend/app/controllers/materials_controller.rb +++ b/backend/app/controllers/materials_controller.rb @@ -14,6 +14,7 @@ class MaterialsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/nico_tags_controller.rb b/backend/app/controllers/nico_tags_controller.rb index 902358d..08a3877 100644 --- a/backend/app/controllers/nico_tags_controller.rb +++ b/backend/app/controllers/nico_tags_controller.rb @@ -15,6 +15,7 @@ class NicoTagsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 post_tag_max_sql = PostExternalTag diff --git a/backend/app/controllers/post_versions_controller.rb b/backend/app/controllers/post_versions_controller.rb index cf07119..9a3b641 100644 --- a/backend/app/controllers/post_versions_controller.rb +++ b/backend/app/controllers/post_versions_controller.rb @@ -11,6 +11,7 @@ class PostVersionsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/posts_controller.rb b/backend/app/controllers/posts_controller.rb index ba15e99..34c71b0 100644 --- a/backend/app/controllers/posts_controller.rb +++ b/backend/app/controllers/posts_controller.rb @@ -34,6 +34,7 @@ class PostsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/tag_versions_controller.rb b/backend/app/controllers/tag_versions_controller.rb index 95c71d0..4668cd9 100644 --- a/backend/app/controllers/tag_versions_controller.rb +++ b/backend/app/controllers/tag_versions_controller.rb @@ -7,6 +7,7 @@ class TagVersionsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/tags_controller.rb b/backend/app/controllers/tags_controller.rb index 7c6feac..3162f14 100644 --- a/backend/app/controllers/tags_controller.rb +++ b/backend/app/controllers/tags_controller.rb @@ -33,6 +33,7 @@ class TagsController < ApplicationController page = 1 if page < 1 limit = 1 if limit < 1 + limit = 100 if limit > 100 offset = (page - 1) * limit diff --git a/backend/app/controllers/theatre_comments_controller.rb b/backend/app/controllers/theatre_comments_controller.rb index 599a57e..4342983 100644 --- a/backend/app/controllers/theatre_comments_controller.rb +++ b/backend/app/controllers/theatre_comments_controller.rb @@ -2,6 +2,7 @@ class TheatreCommentsController < ApplicationController def index limit = params[:limit].to_i limit = 20 if limit <= 0 + limit = 100 if limit > 100 no_gt = params[:no_gt].to_i no_gt = 0 if no_gt < 0 @@ -9,6 +10,7 @@ class TheatreCommentsController < ApplicationController comments = TheatreComment .where(theatre_id: params[:theatre_id]) .where('no > ?', no_gt) + .includes(:user) .order(no: :desc) .limit(limit) diff --git a/backend/app/controllers/theatre_programmes_controller.rb b/backend/app/controllers/theatre_programmes_controller.rb index b386f63..bf6c917 100644 --- a/backend/app/controllers/theatre_programmes_controller.rb +++ b/backend/app/controllers/theatre_programmes_controller.rb @@ -2,6 +2,7 @@ class TheatreProgrammesController < ApplicationController def index limit = params[:limit].to_i limit = 100 if limit <= 0 + limit = 100 if limit > 100 position_gt = params[:position_gt].to_i position_gt = 0 if position_gt < 0 @@ -10,7 +11,7 @@ class TheatreProgrammesController < ApplicationController .where(theatre_id: params[:theatre_id]) .where('position > ?', position_gt) .includes(:post) - .order(position: :desc).limit(100) + .order(position: :desc) .limit(limit) render json: programmes.map { |programme| diff --git a/backend/app/controllers/theatre_skip_events_controller.rb b/backend/app/controllers/theatre_skip_events_controller.rb index c5047c5..4cb05de 100644 --- a/backend/app/controllers/theatre_skip_events_controller.rb +++ b/backend/app/controllers/theatre_skip_events_controller.rb @@ -2,6 +2,7 @@ class TheatreSkipEventsController < ApplicationController def index limit = params[:limit].to_i limit = 50 if limit <= 0 + limit = 100 if limit > 100 events = TheatreSkipEvent