mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 12:55:56 +01: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
1 changed files with 2 additions and 1 deletions
|
@ -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