chore: split ticket in multiple componentts

This commit is contained in:
canove
2020-10-13 16:16:48 -03:00
parent 011d8d5dfe
commit 0b91a341ed
7 changed files with 605 additions and 525 deletions

View File

@@ -27,19 +27,26 @@ const verifyContact = async (
msgContact: WbotContact,
profilePicUrl: string
): Promise<Contact> => {
const io = getIO();
let contact = await Contact.findOne({
where: { number: msgContact.id.user }
});
if (contact) {
await contact.update({ profilePicUrl });
io.emit("contact", {
action: "update",
contact
});
} else {
contact = await Contact.create({
name: msgContact.name || msgContact.pushname || msgContact.id.user,
number: msgContact.id.user,
profilePicUrl
});
const io = getIO();
io.emit("contact", {
action: "create",
contact