Move reaction endpoints from route.rb to api.rb

This commit is contained in:
Jeremy Kescher 2023-05-09 23:08:13 +02:00
parent 290e1cb42d
commit af549a7d8d
No known key found for this signature in database
GPG Key ID: 80A419A7A613DFA4
1 changed files with 6 additions and 0 deletions

View File

@ -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