Block too short antenna keyword
This commit is contained in:
parent
53fc503910
commit
cfba10448e
1 changed files with 1 additions and 0 deletions
|
@ -17,6 +17,7 @@ class Api::V1::Antennas::KeywordsController < Api::BaseController
|
|||
new_keywords = @antenna.keywords || []
|
||||
keywords.each do |keyword|
|
||||
raise Mastodon::ValidationError, I18n.t('antennas.errors.duplicate_keyword') if new_keywords.include?(keyword)
|
||||
raise Mastodon::ValidationError, I18n.t('antennas.errors.too_short_keyword') if keyword.length < 2
|
||||
|
||||
new_keywords << keyword
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue