about summary refs log tree commit diff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-06-10 03:39:26 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-06-10 09:39:26 +0200
commit2925372ff44347fa7066c380a5d51dd35f80682f (patch)
tree522c9bae03bbb1bbc7740a7edbddcce15195cd88 /config/routes.rb
parent778430b54a97b619189aaa4140f3e9fc16025323 (diff)
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
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb21
1 files changed, 10 insertions, 11 deletions
diff --git a/config/routes.rb b/config/routes.rb
index d0236a43a..601330d39 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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