Move emoji reaction limitation constraints

This commit is contained in:
KMY 2023-03-08 16:31:22 +09:00
parent dcf52daa9b
commit 47bedd20ca
6 changed files with 21 additions and 5 deletions

View file

@ -3,7 +3,6 @@
class Api::BaseController < ApplicationController
DEFAULT_STATUSES_LIMIT = 20
DEFAULT_ACCOUNTS_LIMIT = 40
DEFAULT_EMOJI_REACTION_LIMIT = 10
include RateLimitHeaders
include AccessTokenTrackingConcern

View file

@ -42,7 +42,7 @@ class Api::V1::Statuses::EmojiReactionsController < Api::BaseController
def create_private(emoji)
count = EmojiReaction.where(account: current_account, status: @status).count
if count >= DEFAULT_EMOJI_REACTION_LIMIT
if count >= EmojiReaction::EMOJI_REACTION_PER_ACCOUNT_LIMIT
bad_request
return
end