Move reaction endpoints from route.rb to api.rb
This commit is contained in:
parent
290e1cb42d
commit
af549a7d8d
|
@ -16,6 +16,11 @@ namespace :api, format: false do
|
||||||
resource :favourite, only: :create
|
resource :favourite, only: :create
|
||||||
post :unfavourite, to: 'favourites#destroy'
|
post :unfavourite, to: 'favourites#destroy'
|
||||||
|
|
||||||
|
# foreign custom emojis are encoded as shortcode@domain.tld
|
||||||
|
# the constraint prevents rails from interpreting the ".tld" as a filename extension
|
||||||
|
post '/react/:id', to: 'reactions#create', constraints: { id: /[^\/]+/ }
|
||||||
|
post '/unreact/:id', to: 'reactions#destroy', constraints: { id: /[^\/]+/ }
|
||||||
|
|
||||||
resource :bookmark, only: :create
|
resource :bookmark, only: :create
|
||||||
post :unbookmark, to: 'bookmarks#destroy'
|
post :unbookmark, to: 'bookmarks#destroy'
|
||||||
|
|
||||||
|
@ -27,6 +32,7 @@ namespace :api, format: false do
|
||||||
|
|
||||||
resource :history, only: :show
|
resource :history, only: :show
|
||||||
resource :source, only: :show
|
resource :source, only: :show
|
||||||
|
resources :reactions, only: [:update, :destroy]
|
||||||
|
|
||||||
post :translate, to: 'translations#create'
|
post :translate, to: 'translations#create'
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue