diff --git a/src/components/InstitucionalForm/Schema/InstitucionalFormSchema.ts b/src/components/InstitucionalForm/Schema/InstitucionalFormSchema.ts index 7ced46b..6421ee7 100644 --- a/src/components/InstitucionalForm/Schema/InstitucionalFormSchema.ts +++ b/src/components/InstitucionalForm/Schema/InstitucionalFormSchema.ts @@ -1,15 +1,15 @@ import * as Yup from "yup"; export default Yup.object().shape({ - name: Yup.string().required("*Campo Obrigatório").matches(/^[a-zA-Z\u00C0-\u017F´]{3,}?[+\s+]?[a-zA-Z\u00C0-\u017F´]{0,}$/, "*Nome Inválido"), + name: Yup.string().required("*Campo Obrigatório").matches(/^([a-zA-Z\u00C0-\u017F´]{3,}?[+\s+]?[+a-zA-Z\u00C0-\u017F´]{0,})+$/, "*Nome Inválido"), email: Yup.string().required("*Campo Obrigatório").email("*E-mail Inválido"), cpf: Yup.string().required("*Campo Obrigatório").matches(/^([0-9]{3}\.?[0-9]{3}\.?[0-9]{3}\-?[0-9]{2})$/, "*CPF Inválido"), birthDate: Yup.string().required("*Campo Obrigatório").matches(/^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[13-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/, "*Data Inválida"), - - phone: Yup.string().required("*Campo Obrigatório").matches(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/, "*Número Inválido"), + + phone: Yup.string().required("*Campo Obrigatório").matches(/^[\+]?[(]?[0-9]{2}[)]?[\s]?[0-9]{4,5}[-\s\.]?[0-9]{4}$/, "*Número Inválido"), instagram: Yup.string().matches(/^(?:@)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)$/, "*Instagram Inválido"),