fix bugs vcard

[ PT-BR ] -  Corrigido bug quando enviado vcard sem numero de telefone.

[ US ] - Corrected bug when sent vcard without phone number.
This commit is contained in:
jhonnatanBezerra
2022-08-04 17:52:39 -04:00
parent e13f93db3d
commit 6b56b07214
2 changed files with 84 additions and 83 deletions

View File

@@ -446,7 +446,7 @@ const MessagesList = ({ ticketId, isGroup }) => {
} }
} }
} }
return <VcardPreview contact={contact} numbers={obj[0].number} /> return <VcardPreview contact={contact} numbers={obj[0]?.number} />
} }
/*else if (message.mediaType === "multi_vcard") { /*else if (message.mediaType === "multi_vcard") {
console.log("multi_vcard") console.log("multi_vcard")

View File

@@ -27,7 +27,8 @@ const VcardPreview = ({ contact, numbers }) => {
try { try {
let contactObj = { let contactObj = {
name: contact, name: contact,
number: numbers.replace(/\D/g, ""), // number: numbers.replace(/\D/g, ""),
number: numbers !== undefined && numbers.replace(/\D/g, ""),
email: "" email: ""
} }
const { data } = await api.post("/contact", contactObj); const { data } = await api.post("/contact", contactObj);