refactor: Aplica mudanças no código

This commit is contained in:
Sabrina Miranda 2023-01-16 17:53:56 -03:00
parent e44c19270a
commit 4b03d22a67

View File

@ -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"),