Remove deprecated REST API `GET /api/v1/statuses/:id/card` (#11213)

This commit is contained in:
Eugen Rochko 2019-07-05 02:15:24 +02:00 committed by GitHub
parent 30f5bcf3e7
commit 0c1b1069c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 27 deletions

View File

@ -5,8 +5,8 @@ class Api::V1::StatusesController < Api::BaseController
before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy] before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy]
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:create, :destroy] before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:create, :destroy]
before_action :require_user!, except: [:show, :context, :card] before_action :require_user!, except: [:show, :context]
before_action :set_status, only: [:show, :context, :card] before_action :set_status, only: [:show, :context]
respond_to :json respond_to :json
@ -33,16 +33,6 @@ class Api::V1::StatusesController < Api::BaseController
render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id) render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id)
end end
def card
@card = @status.preview_cards.first
if @card.nil?
render_empty
else
render json: @card, serializer: REST::PreviewCardSerializer
end
end
def create def create
@status = PostStatusService.new.call(current_user.account, @status = PostStatusService.new.call(current_user.account,
text: status_params[:status], text: status_params[:status],

View File

@ -294,7 +294,6 @@ Rails.application.routes.draw do
member do member do
get :context get :context
get :card
end end
end end

View File

@ -91,13 +91,6 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
expect(response).to have_http_status(404) expect(response).to have_http_status(404)
end end
end end
describe 'GET #card' do
it 'returns http unautharized' do
get :card, params: { id: status.id }
expect(response).to have_http_status(404)
end
end
end end
context 'with a public status' do context 'with a public status' do
@ -120,13 +113,6 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
end end
end end
describe 'GET #card' do
it 'returns http success' do
get :card, params: { id: status.id }
expect(response).to have_http_status(200)
end
end
end end
end end
end end