Fix emoji reaction too many error

This commit is contained in:
KMY 2023-04-08 09:21:56 +09:00
parent 8719715e27
commit 58294bcc31

View file

@ -41,11 +41,7 @@ class Api::V1::Statuses::EmojiReactionsController < Api::BaseController
def create_private(emoji) def create_private(emoji)
count = EmojiReaction.where(account: current_account, status: @status).count count = EmojiReaction.where(account: current_account, status: @status).count
raise Mastodon::ValidationError, I18n.t('reactions.errors.limit_reached') if count >= EmojiReaction::EMOJI_REACTION_PER_ACCOUNT_LIMIT
if count >= EmojiReaction::EMOJI_REACTION_PER_ACCOUNT_LIMIT
bad_request
return
end
EmojiReactService.new.call(current_account, @status, emoji) EmojiReactService.new.call(current_account, @status, emoji)
render json: @status, serializer: REST::StatusSerializer render json: @status, serializer: REST::StatusSerializer