mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
chore: split ticket in multiple componentts
This commit is contained in:
@@ -56,8 +56,12 @@ const UpdateContactService = async ({
|
||||
await contact.update({
|
||||
name,
|
||||
number,
|
||||
email,
|
||||
extraInfo
|
||||
email
|
||||
});
|
||||
|
||||
await contact.reload({
|
||||
attributes: ["id", "name", "number", "email", "profilePicUrl"],
|
||||
include: ["extraInfo"]
|
||||
});
|
||||
|
||||
return contact;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user