Skip to content

Commit 1f5423c

Browse files
authored
Remove deprecated REST API GET /api/v1/statuses/:id/card (mastodon#11213)
1 parent 73256db commit 1f5423c

3 files changed

Lines changed: 2 additions & 27 deletions

File tree

app/controllers/api/v1/statuses_controller.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class Api::V1::StatusesController < Api::BaseController
55

66
before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy]
77
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:create, :destroy]
8-
before_action :require_user!, except: [:show, :context, :card]
9-
before_action :set_status, only: [:show, :context, :card]
8+
before_action :require_user!, except: [:show, :context]
9+
before_action :set_status, only: [:show, :context]
1010

1111
respond_to :json
1212

@@ -33,16 +33,6 @@ def context
3333
render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id)
3434
end
3535

36-
def card
37-
@card = @status.preview_cards.first
38-
39-
if @card.nil?
40-
render_empty
41-
else
42-
render json: @card, serializer: REST::PreviewCardSerializer
43-
end
44-
end
45-
4636
def create
4737
@status = PostStatusService.new.call(current_user.account,
4838
text: status_params[:status],

config/routes.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@
294294

295295
member do
296296
get :context
297-
get :card
298297
end
299298
end
300299

spec/controllers/api/v1/statuses_controller_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@
9191
expect(response).to have_http_status(404)
9292
end
9393
end
94-
95-
describe 'GET #card' do
96-
it 'returns http unautharized' do
97-
get :card, params: { id: status.id }
98-
expect(response).to have_http_status(404)
99-
end
100-
end
10194
end
10295

10396
context 'with a public status' do
@@ -120,13 +113,6 @@
120113
expect(response).to have_http_status(200)
121114
end
122115
end
123-
124-
describe 'GET #card' do
125-
it 'returns http success' do
126-
get :card, params: { id: status.id }
127-
expect(response).to have_http_status(200)
128-
end
129-
end
130116
end
131117
end
132118
end

0 commit comments

Comments
 (0)