about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorGomasy <nyan@gomasy.jp>2019-11-18 01:09:42 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-11-17 17:09:41 +0100
commit5a2c0707f163f14565d186db48bf0b4fe0b05b4f (patch)
treef274670f3520d60b3e8347132f9cd7511b771345 /app/controllers
parentdf15a2cd375da328f16537655aca15c8dd3030e5 (diff)
Support min_id-based pagination for bookmarks (#12381)
* Support min_id-based pagination for bookmarks

* Fix spec
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v1/bookmarks_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/api/v1/bookmarks_controller.rb b/app/controllers/api/v1/bookmarks_controller.rb
index cf4cba8dd..e1b244e76 100644
--- a/app/controllers/api/v1/bookmarks_controller.rb
+++ b/app/controllers/api/v1/bookmarks_controller.rb
@@ -26,10 +26,9 @@ class Api::V1::BookmarksController < Api::BaseController
   end
 
   def results
-    @_results ||= account_bookmarks.paginate_by_max_id(
+    @_results ||= account_bookmarks.paginate_by_id(
       limit_param(DEFAULT_STATUSES_LIMIT),
-      params[:max_id],
-      params[:since_id]
+      params_slice(:max_id, :since_id, :min_id)
     )
   end
 
@@ -46,7 +45,7 @@ class Api::V1::BookmarksController < Api::BaseController
   end
 
   def prev_path
-    api_v1_bookmarks_url pagination_params(since_id: pagination_since_id) unless results.empty?
+    api_v1_bookmarks_url pagination_params(min_id: pagination_since_id) unless results.empty?
   end
 
   def pagination_max_id