mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
19 lines
390 B
JavaScript
19 lines
390 B
JavaScript
const Contact = require("../models/Contact");
|
|
const Message = require("../models/Message");
|
|
// const io = require("../socket");
|
|
|
|
exports.getContacts = async (req, res) => {
|
|
// const contacts = await Contact.findAll();
|
|
const contacts = await Contact.findAll({
|
|
include: {
|
|
model: Message,
|
|
where: {
|
|
read: false,
|
|
},
|
|
required: false,
|
|
},
|
|
});
|
|
|
|
return res.json(contacts);
|
|
};
|