From b353c835af8dea02aa0d4a6d70f290907814e069 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 10 Aug 2020 22:22:08 -0500 Subject: [PATCH] Updated GroupCollectionTimeline, GroupTimeline to insert pagingation headers only if min is met MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - GroupCollectionTimeline, GroupTimeline to insert pagingation headers only if min is met --- .../api/v1/timelines/group_collection_controller.rb | 4 +++- app/controllers/api/v1/timelines/group_controller.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/timelines/group_collection_controller.rb b/app/controllers/api/v1/timelines/group_collection_controller.rb index 9fcd042f..6fd59671 100644 --- a/app/controllers/api/v1/timelines/group_collection_controller.rb +++ b/app/controllers/api/v1/timelines/group_collection_controller.rb @@ -5,7 +5,9 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController before_action :set_sort_type before_action :set_statuses - after_action :insert_pagination_headers, unless: -> { @statuses.empty? } + after_action :insert_pagination_headers, unless: -> { + @statuses.empty? || @statuses.length < DEFAULT_STATUSES_LIMIT + } def show if current_user diff --git a/app/controllers/api/v1/timelines/group_controller.rb b/app/controllers/api/v1/timelines/group_controller.rb index 0f76ef85..c41ab47f 100644 --- a/app/controllers/api/v1/timelines/group_controller.rb +++ b/app/controllers/api/v1/timelines/group_controller.rb @@ -5,7 +5,9 @@ class Api::V1::Timelines::GroupController < Api::BaseController before_action :set_sort_type before_action :set_statuses - after_action :insert_pagination_headers, unless: -> { @statuses.empty? } + after_action :insert_pagination_headers, unless: -> { + @statuses.empty? || @statuses.length < DEFAULT_STATUSES_LIMIT + } def show if current_user