From c29fdadefdaae5a68f6bea85d6ae3b529b6ab7e7 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 8 Jul 2024 03:21:49 -0400 Subject: [PATCH] Use `scope module: ...` for more API routes (#30935) --- config/routes/api.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/routes/api.rb b/config/routes/api.rb index 3eb4bb4b4d5..90119166974 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -203,9 +203,11 @@ namespace :api, format: false do post :unmute end - resource :pin, only: :create, controller: 'accounts/pins' - post :unpin, to: 'accounts/pins#destroy' - resource :note, only: :create, controller: 'accounts/notes' + scope module: :accounts do + resource :pin, only: :create + post :unpin, to: 'pins#destroy' + resource :note, only: :create + end end resources :tags, only: [:show] do @@ -218,7 +220,7 @@ namespace :api, format: false do resources :followed_tags, only: [:index] 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 namespace :featured_tags do @@ -228,7 +230,7 @@ namespace :api, format: false do resources :featured_tags, only: [:index, :create, :destroy] resources :polls, only: [:create, :show] do - resources :votes, only: :create, controller: 'polls/votes' + resources :votes, only: :create, module: :polls end namespace :push do @@ -314,8 +316,10 @@ namespace :api, format: false do resources :suggestions, only: [:index] resource :instance, only: [:show] resources :filters, only: [:index, :create, :show, :update, :destroy] do - resources :keywords, only: [:index, :create], controller: 'filters/keywords' - resources :statuses, only: [:index, :create], controller: 'filters/statuses' + scope module: :filters do + resources :keywords, only: [:index, :create] + resources :statuses, only: [:index, :create] + end end namespace :filters do