Browse Source

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

Eugen Rochko 2 weeks ago
parent
commit
0c1b1069c9
No account linked to committer's email address

+ 2
- 12
app/controllers/api/v1/statuses_controller.rb View File

@@ -5,8 +5,8 @@ class Api::V1::StatusesController < Api::BaseController
5 5
 
6 6
   before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy]
7 7
   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]
10 10
 
11 11
   respond_to :json
12 12
 
@@ -33,16 +33,6 @@ class Api::V1::StatusesController < Api::BaseController
33 33
     render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id)
34 34
   end
35 35
 
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
-
46 36
   def create
47 37
     @status = PostStatusService.new.call(current_user.account,
48 38
                                          text: status_params[:status],

+ 0
- 1
config/routes.rb View File

@@ -294,7 +294,6 @@ Rails.application.routes.draw do
294 294
 
295 295
         member do
296 296
           get :context
297
-          get :card
298 297
         end
299 298
       end
300 299
 

+ 0
- 14
spec/controllers/api/v1/statuses_controller_spec.rb View File

@@ -91,13 +91,6 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
91 91
           expect(response).to have_http_status(404)
92 92
         end
93 93
       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
101 94
     end
102 95
 
103 96
     context 'with a public status' do
@@ -120,13 +113,6 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
120 113
           expect(response).to have_http_status(200)
121 114
         end
122 115
       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
130 116
     end
131 117
   end
132 118
 end

Loading…
Cancel
Save