|
|
@ -38,12 +38,12 @@ const form = reactive({ |
|
|
|
const formRules: Record<string, RuleObject[]> = { |
|
|
|
const formRules: Record<string, RuleObject[]> = { |
|
|
|
email: [ |
|
|
|
email: [ |
|
|
|
// E-mail is required |
|
|
|
// E-mail is required |
|
|
|
{ required: true, message: t('msg.error.signUpRules.emailReqd') }, |
|
|
|
{ required: true, message: t('msg.error.signUpRules.emailRequired') }, |
|
|
|
// E-mail must be valid format |
|
|
|
// E-mail must be valid format |
|
|
|
{ |
|
|
|
{ |
|
|
|
validator: (_: unknown, v: string) => { |
|
|
|
validator: (_: unknown, v: string) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (validateEmail(v)) return resolve() |
|
|
|
if (!v?.length || validateEmail(v)) return resolve() |
|
|
|
|
|
|
|
|
|
|
|
reject(new Error(t('msg.error.signUpRules.emailInvalid'))) |
|
|
|
reject(new Error(t('msg.error.signUpRules.emailInvalid'))) |
|
|
|
}) |
|
|
|
}) |
|
|
|