mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
* feat: add v2 accounts controller * feat: allow empty account and user name * feat: ensure and is present for v1 signup * test: remove validation checks * chore: apply suggestions * chore: revert en.yml formatting * chore: line at EOF * fix: routes --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
44 lines
940 B
Ruby
44 lines
940 B
Ruby
# frozen_string_literal: true
|
|
|
|
module CustomExceptions::Account
|
|
class InvalidEmail < CustomExceptions::Base
|
|
def message
|
|
if @data[:disposable]
|
|
I18n.t 'errors.signup.disposable_email'
|
|
elsif !@data[:valid]
|
|
I18n.t 'errors.signup.invalid_email'
|
|
end
|
|
end
|
|
end
|
|
|
|
class UserExists < CustomExceptions::Base
|
|
def message
|
|
I18n.t('errors.signup.email_already_exists', email: @data[:email])
|
|
end
|
|
end
|
|
|
|
class InvalidParams < CustomExceptions::Base
|
|
def message
|
|
I18n.t 'errors.signup.invalid_params'
|
|
end
|
|
end
|
|
|
|
class UserErrors < CustomExceptions::Base
|
|
def message
|
|
@data[:errors].full_messages.join(',')
|
|
end
|
|
end
|
|
|
|
class SignupFailed < CustomExceptions::Base
|
|
def message
|
|
I18n.t 'errors.signup.failed'
|
|
end
|
|
end
|
|
|
|
class PlanUpgradeRequired < CustomExceptions::Base
|
|
def message
|
|
I18n.t 'errors.plan_upgrade_required.failed'
|
|
end
|
|
end
|
|
end
|