Use `scope module: ...` for more API routes (#30935)

pull/30958/head
Matt Jankowski 2024-07-08 03:21:49 -04:00 committed by GitHub
parent bd285cdd02
commit c29fdadefd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 7 deletions

View File

@ -203,9 +203,11 @@ namespace :api, format: false do
post :unmute post :unmute
end end
resource :pin, only: :create, controller: 'accounts/pins' scope module: :accounts do
post :unpin, to: 'accounts/pins#destroy' resource :pin, only: :create
resource :note, only: :create, controller: 'accounts/notes' post :unpin, to: 'pins#destroy'
resource :note, only: :create
end
end end
resources :tags, only: [:show] do resources :tags, only: [:show] do
@ -218,7 +220,7 @@ namespace :api, format: false do
resources :followed_tags, only: [:index] resources :followed_tags, only: [:index]
resources :lists, only: [:index, :create, :show, :update, :destroy] do resources :lists, only: [:index, :create, :show, :update, :destroy] do
resource :accounts, only: [:show, :create, :destroy], controller: 'lists/accounts' resource :accounts, only: [:show, :create, :destroy], module: :lists
end end
namespace :featured_tags do namespace :featured_tags do
@ -228,7 +230,7 @@ namespace :api, format: false do
resources :featured_tags, only: [:index, :create, :destroy] resources :featured_tags, only: [:index, :create, :destroy]
resources :polls, only: [:create, :show] do resources :polls, only: [:create, :show] do
resources :votes, only: :create, controller: 'polls/votes' resources :votes, only: :create, module: :polls
end end
namespace :push do namespace :push do
@ -314,8 +316,10 @@ namespace :api, format: false do
resources :suggestions, only: [:index] resources :suggestions, only: [:index]
resource :instance, only: [:show] resource :instance, only: [:show]
resources :filters, only: [:index, :create, :show, :update, :destroy] do resources :filters, only: [:index, :create, :show, :update, :destroy] do
resources :keywords, only: [:index, :create], controller: 'filters/keywords' scope module: :filters do
resources :statuses, only: [:index, :create], controller: 'filters/statuses' resources :keywords, only: [:index, :create]
resources :statuses, only: [:index, :create]
end
end end
namespace :filters do namespace :filters do