Follow fedibird delete emoji-reaction api

This commit is contained in:
KMY 2023-03-06 10:31:50 +09:00
parent 3c3da81352
commit 673296b86f
2 changed files with 3 additions and 3 deletions

View file

@ -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('@')

View file

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