mirror of https://github.com/tootsuite/mastodon
Index returned entries by id
parent
6aea440a0e
commit
e4bf427f65
|
@ -22,7 +22,7 @@ class Api::V1::AccountsController < Api::BaseController
|
|||
override_rate_limit_headers :follow, family: :follows
|
||||
|
||||
def index
|
||||
render json: @accounts, each_serializer: REST::AccountSerializer
|
||||
render json: @accounts.map { |account| ActiveModelSerializers::SerializableResource.new(account, serializer: REST::AccountSerializer, scope: current_user, scope_name: :current_user).as_json }.index_by { |account| account[:id] }
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -27,7 +27,7 @@ class Api::V1::StatusesController < Api::BaseController
|
|||
|
||||
def index
|
||||
@statuses = cache_collection(@statuses, Status)
|
||||
render json: @statuses, each_serializer: REST::StatusSerializer
|
||||
render json: @statuses.map { |status| ActiveModelSerializers::SerializableResource.new(status, serializer: REST::StatusSerializer, scope: current_user, scope_name: :current_user).as_json }.index_by { |status| status[:id] }
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
Loading…
Reference in New Issue