mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
working
This commit is contained in:
18
backend/controllers/contact.js
Normal file
18
backend/controllers/contact.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
};
|
||||
Reference in New Issue
Block a user