Fix emoji reaction too many error
This commit is contained in:
parent
8719715e27
commit
58294bcc31
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue