diff --git a/backend/src/controllers/ContactController.ts b/backend/src/controllers/ContactController.ts index 1c05596..c5099b0 100644 --- a/backend/src/controllers/ContactController.ts +++ b/backend/src/controllers/ContactController.ts @@ -88,6 +88,7 @@ export const store = async (req: Request, res: Response): Promise => { 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 { diff --git a/backend/src/services/MessageServices/CreateMessageService.ts b/backend/src/services/MessageServices/CreateMessageService.ts index 7a09947..11a009b 100644 --- a/backend/src/services/MessageServices/CreateMessageService.ts +++ b/backend/src/services/MessageServices/CreateMessageService.ts @@ -20,7 +20,7 @@ interface Request { const CreateMessageService = async ({ messageData }: Request): Promise => { - console.log('UPSERT MESSAGE messageData: ', messageData) + // console.log('UPSERT MESSAGE messageData: ', messageData) try {