diff --git a/app/controllers/api/v1/statuses/emoji_reactions_controller.rb b/app/controllers/api/v1/statuses/emoji_reactions_controller.rb index 88a3ac4644..da68f5813c 100644 --- a/app/controllers/api/v1/statuses/emoji_reactions_controller.rb +++ b/app/controllers/api/v1/statuses/emoji_reactions_controller.rb @@ -5,7 +5,7 @@ class Api::V1::Statuses::EmojiReactionsController < Api::BaseController before_action -> { doorkeeper_authorize! :write, :'write:emoji_reactions' } before_action :require_user! - before_action :set_status, only: %i(create update) + before_action :set_status, only: %i(create update destroy) before_action :set_status_without_authorize, only: [:destroy] def create @@ -18,7 +18,7 @@ class Api::V1::Statuses::EmojiReactionsController < Api::BaseController end def destroy - emoji = params[:emoji] + emoji = params[:emoji] || params[:id] if emoji shortcode, domain = emoji.split('@') diff --git a/config/routes.rb b/config/routes.rb index 82ec5a5f4b..3ee7a8069d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -463,7 +463,7 @@ Rails.application.routes.draw do post :translate, to: 'translations#create' - resources :emoji_reactions, only: [:create, :update], constraints: { id: /[^\/]+/ } + resources :emoji_reactions, only: [:create, :update, :destroy], constraints: { id: /[^\/]+/ } post :emoji_unreaction, to: 'emoji_reactions#destroy' end