fix: Standardize name validation on agent / profile pages (#1720)
This commit is contained in:
parent
6a614a520b
commit
2012aab1d5
5 changed files with 5 additions and 2 deletions
|
@ -102,7 +102,7 @@ export default {
|
|||
validations: {
|
||||
agentName: {
|
||||
required,
|
||||
minLength: minLength(4),
|
||||
minLength: minLength(1),
|
||||
},
|
||||
agentEmail: {
|
||||
required,
|
||||
|
|
|
@ -112,7 +112,7 @@ export default {
|
|||
validations: {
|
||||
agentName: {
|
||||
required,
|
||||
minLength: minLength(4),
|
||||
minLength: minLength(1),
|
||||
},
|
||||
agentType: {
|
||||
required,
|
||||
|
|
|
@ -136,6 +136,7 @@ export default {
|
|||
validations: {
|
||||
name: {
|
||||
required,
|
||||
minLength: minLength(1),
|
||||
},
|
||||
displayName: {},
|
||||
email: {
|
||||
|
|
|
@ -62,6 +62,7 @@ class User < ApplicationRecord
|
|||
# validates_uniqueness_of :email, scope: :account_id
|
||||
|
||||
validates :email, :name, presence: true
|
||||
validates_length_of :name, minimum: 1
|
||||
|
||||
has_many :account_users, dependent: :destroy
|
||||
has_many :accounts, through: :account_users
|
||||
|
|
|
@ -9,6 +9,7 @@ RSpec.describe User do
|
|||
context 'validations' do
|
||||
it { is_expected.to validate_presence_of(:email) }
|
||||
it { is_expected.to validate_presence_of(:name) }
|
||||
it { is_expected.to validate_length_of(:name).is_at_least(1) }
|
||||
end
|
||||
|
||||
context 'associations' do
|
||||
|
|
Loading…
Reference in a new issue