mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 23:13:33 +00:00
Add support for a new parameter "client_type", so that API clients may specify whether the API semantics should tend towards defaults that are suitable to an editor or a reader type application.
This commit is contained in:
parent
b84bc2de5d
commit
ece32664ff
|
@ -9,7 +9,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
|
|||
def index
|
||||
cache_if_unauthenticated!
|
||||
@statuses = load_statuses
|
||||
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
|
||||
return_source = params[:client_type] == 'editor'
|
||||
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id), source_requested: return_source
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue