Correção para obrigar o usuario a inserir numero com 55 no inicio
parent
4aa90698f1
commit
2c48aafbdb
|
@ -88,6 +88,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
|||
number: Yup.string()
|
||||
.required()
|
||||
.matches(/^\d+$/, "Invalid number format. Only numbers is allowed.")
|
||||
.matches(/^55\d+$/, "The number must start with 55.")
|
||||
});
|
||||
|
||||
try {
|
||||
|
@ -152,10 +153,9 @@ export const update = async (
|
|||
|
||||
const schema = Yup.object().shape({
|
||||
name: Yup.string(),
|
||||
number: Yup.string().matches(
|
||||
/^\d+$/,
|
||||
"Invalid number format. Only numbers is allowed."
|
||||
)
|
||||
number: Yup.string()
|
||||
.matches(/^\d+$/,"Invalid number format. Only numbers is allowed.")
|
||||
.matches(/^55\d+$/, "The number must start with 55.")
|
||||
});
|
||||
|
||||
try {
|
||||
|
|
|
@ -20,7 +20,7 @@ interface Request {
|
|||
|
||||
const CreateMessageService = async ({ messageData }: Request): Promise<Message> => {
|
||||
|
||||
console.log('UPSERT MESSAGE messageData: ', messageData)
|
||||
// console.log('UPSERT MESSAGE messageData: ', messageData)
|
||||
|
||||
try {
|
||||
|
||||
|
|
Loading…
Reference in New Issue