]> cat aescling's git repositories - mastodon.git/commitdiff
Fix block list 500 (#3174)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Sat, 20 May 2017 15:01:14 +0000 (00:01 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 20 May 2017 15:01:14 +0000 (17:01 +0200)
app/controllers/api/v1/blocks_controller.rb

index 37f5ea219d6b83f88cbf23a99b66a979251a455d..b2f3ae51254c902f46d445e30b3f744b390599c9 100644 (file)
@@ -13,8 +13,8 @@ class Api::V1::BlocksController < ApiController
                                    .paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
                        .to_a
 
-    next_path = api_v1_blocks_url(pagination_params(max_id: @accounts.last.blocked_bies.last.id))     if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
-    prev_path = api_v1_blocks_url(pagination_params(since_id: @accounts.first.blocked_bies.first.id)) unless @accounts.empty?
+    next_path = api_v1_blocks_url(pagination_params(max_id: @accounts.last.blocked_by_ids.last))     if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
+    prev_path = api_v1_blocks_url(pagination_params(since_id: @accounts.first.blocked_by_ids.first)) unless @accounts.empty?
 
     set_pagination_headers(next_path, prev_path)
   end