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 20da97252d
commit c4d82b4170
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4

View file

@ -16,6 +16,11 @@ namespace :api, format: false do
resource :favourite, only: :create
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
post :unbookmark, to: 'bookmarks#destroy'
@ -27,6 +32,7 @@ namespace :api, format: false do
resource :history, only: :show
resource :source, only: :show
resources :reactions, only: [:update, :destroy]
post :translate, to: 'translations#create'
end