Move create/destroy actions for api/v1/statuses to namespace (#3678)
Each of mute, favourite, reblog has been updated to: - Have a separate controller with just a create and destroy action - Preserve historical route names to not break the API - Mild refactoring to break up long methods
This commit is contained in:
parent
778430b54a
commit
2925372ff4
10 changed files with 341 additions and 198 deletions
|
@ -129,22 +129,21 @@ Rails.application.routes.draw do
|
|||
namespace :v1 do
|
||||
resources :statuses, only: [:create, :show, :destroy] do
|
||||
scope module: :statuses do
|
||||
with_options only: :index do
|
||||
resources :reblogged_by, controller: :reblogged_by_accounts
|
||||
resources :favourited_by, controller: :favourited_by_accounts
|
||||
end
|
||||
resources :reblogged_by, controller: :reblogged_by_accounts, only: :index
|
||||
resources :favourited_by, controller: :favourited_by_accounts, only: :index
|
||||
resource :reblog, only: :create
|
||||
post :unreblog, to: 'reblogs#destroy'
|
||||
|
||||
resource :favourite, only: :create
|
||||
post :unfavourite, to: 'favourites#destroy'
|
||||
|
||||
resource :mute, only: :create
|
||||
post :unmute, to: 'mutes#destroy'
|
||||
end
|
||||
|
||||
member do
|
||||
get :context
|
||||
get :card
|
||||
|
||||
post :reblog
|
||||
post :unreblog
|
||||
post :favourite
|
||||
post :unfavourite
|
||||
post :mute
|
||||
post :unmute
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue