From 8e24f3721980a15d7f15894e85ef699681e58462 Mon Sep 17 00:00:00 2001 From: adriano Date: Thu, 7 Mar 2024 09:43:04 -0300 Subject: [PATCH] fix: bug ignored wrong number connected in the application --- backend/src/controllers/WhatsAppController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/controllers/WhatsAppController.ts b/backend/src/controllers/WhatsAppController.ts index 014fc20..e8e0499 100644 --- a/backend/src/controllers/WhatsAppController.ts +++ b/backend/src/controllers/WhatsAppController.ts @@ -230,9 +230,9 @@ export const weebhook = async ( req.body.entry[0].changes[0].value.metadata.display_phone_number; let type = message.type; - const contact_from_exist = await get("whatsapp:*", `${contact_from}`); + const contact_to_exist = await get("whatsapp:*", `${contact_to}`); - if (!contact_from_exist) { + if (contact_to_exist == null) { console.log( "WHATSAPP OFFICIAL", " | CONCTACT_FROM: ",