mirror of
https://github.com/mastodon/mastodon
synced 2024-12-12 21:58:20 +09:00
Use concern for routes
This commit is contained in:
parent
c4179b333f
commit
5684d666a9
@ -125,7 +125,7 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
get '/authorize_follow', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" }
|
get '/authorize_follow', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" }
|
||||||
|
|
||||||
resources :accounts, path: 'users', only: [:show], param: :username do
|
concern :account_resources do
|
||||||
resources :statuses, only: [:show] do
|
resources :statuses, only: [:show] do
|
||||||
member do
|
member do
|
||||||
get :activity
|
get :activity
|
||||||
@ -148,28 +148,8 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :accounts, path: 'u', only: [:show], param: :id, as: :numeric_account do
|
resources :accounts, path: 'users', only: [:show], param: :username, concerns: :account_resources
|
||||||
resources :statuses, only: [:show] do
|
resources :accounts, path: 'u', only: [:show], param: :id, as: :numeric_account, concerns: :account_resources
|
||||||
member do
|
|
||||||
get :activity
|
|
||||||
get :embed
|
|
||||||
end
|
|
||||||
|
|
||||||
resources :replies, only: [:index], module: :activitypub
|
|
||||||
resources :likes, only: [:index], module: :activitypub
|
|
||||||
resources :shares, only: [:index], module: :activitypub
|
|
||||||
end
|
|
||||||
|
|
||||||
resources :followers, only: [:index], controller: :follower_accounts
|
|
||||||
resources :following, only: [:index], controller: :following_accounts
|
|
||||||
|
|
||||||
scope module: :activitypub do
|
|
||||||
resource :outbox, only: [:show]
|
|
||||||
resource :inbox, only: [:create]
|
|
||||||
resources :collections, only: [:show]
|
|
||||||
resource :followers_synchronization, only: [:show]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
resource :inbox, only: [:create], module: :activitypub
|
resource :inbox, only: [:create], module: :activitypub
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user