diff options
Diffstat (limited to 'lib/api/helpers/pagination.rb')
-rw-r--r-- | lib/api/helpers/pagination.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/api/helpers/pagination.rb b/lib/api/helpers/pagination.rb index 642053949d9..9c5b355e823 100644 --- a/lib/api/helpers/pagination.rb +++ b/lib/api/helpers/pagination.rb @@ -4,21 +4,7 @@ module API module Helpers module Pagination def paginate(relation) - return Gitlab::Pagination::OffsetPagination.new(self).paginate(relation) unless keyset_pagination_enabled? - - request_context = Gitlab::Pagination::Keyset::RequestContext.new(self) - - unless Gitlab::Pagination::Keyset.available?(request_context, relation) - return error!('Keyset pagination is not yet available for this type of request', 501) - end - - Gitlab::Pagination::Keyset.paginate(request_context, relation) - end - - private - - def keyset_pagination_enabled? - params[:pagination] == 'keyset' && Feature.enabled?(:api_keyset_pagination) + ::Gitlab::Pagination::OffsetPagination.new(self).paginate(relation) end end end |