mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
📬 feat: Agent Support Email Address Validation (#9128)
* fix: email-regex realtime updates and looser validation * feat: add zod validation to email address input * refactor: emailValidation to email
This commit is contained in:
parent
822e2310ce
commit
639c7ad6ad
5 changed files with 34 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
processAgentOption,
|
||||
getEndpointField,
|
||||
defaultTextProps,
|
||||
validateEmail,
|
||||
getIconKey,
|
||||
cn,
|
||||
} from '~/utils';
|
||||
|
|
@ -445,10 +446,8 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
|
|||
name="support_contact.email"
|
||||
control={control}
|
||||
rules={{
|
||||
pattern: {
|
||||
value: /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,
|
||||
message: localize('com_ui_support_contact_email_invalid'),
|
||||
},
|
||||
validate: (value) =>
|
||||
validateEmail(value ?? '', localize('com_ui_support_contact_email_invalid')),
|
||||
}}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue