Finished Contact Drawer styles and func

This commit is contained in:
canove
2020-07-27 16:51:54 -03:00
parent 66a1dc5fd2
commit 9477e46c24
12 changed files with 212 additions and 128 deletions

View File

@@ -48,8 +48,9 @@ exports.index = async (req, res, next) => {
include: [
{
model: Contact,
as: "contact",
include: "extraInfo",
attributes: ["name", "number", "profilePicUrl"],
attributes: ["id", "name", "number", "profilePicUrl"],
},
],
});
@@ -81,7 +82,6 @@ exports.index = async (req, res, next) => {
return res.json({
messages: serializedMessages.reverse(),
ticket: ticket,
contact: ticket.Contact,
});
};
@@ -98,6 +98,7 @@ exports.store = async (req, res, next) => {
include: [
{
model: Contact,
as: "contact",
attributes: ["number"],
},
],
@@ -113,12 +114,12 @@ exports.store = async (req, res, next) => {
}
sentMessage = await wbot.sendMessage(
`${ticket.Contact.number}@c.us`,
`${ticket.contact.number}@c.us`,
newMedia
);
} else {
sentMessage = await wbot.sendMessage(
`${ticket.Contact.number}@c.us`,
`${ticket.contact.number}@c.us`,
message.body
);
}

View File

@@ -22,6 +22,7 @@ exports.index = async (req, res) => {
include: [
{
model: Contact,
as: "contact",
attributes: ["name", "number", "profilePicUrl"],
},
],
@@ -60,6 +61,7 @@ exports.update = async (req, res) => {
include: [
{
model: Contact,
as: "contact",
attributes: ["name", "number", "profilePicUrl"],
},
],