All models using classes and sequelize migrations

This commit is contained in:
canove
2020-07-17 14:29:10 -03:00
parent a41f7e63ac
commit 9687a1ce13
22 changed files with 578 additions and 191 deletions

View File

@@ -0,0 +1,23 @@
const Whatsapp = require("../models/Whatsapp");
// const { getIO } = require("../libs/socket");
// const { getWbot, init } = require("../libs/wbot");
exports.show = async (req, res, next) => {
const { sessionId } = req.params;
const dbSession = await Whatsapp.findByPk(sessionId);
if (!dbSession) {
return res.status(200).json({ message: "Session not found" });
}
return res.status(200).json(dbSession);
};
// exports.getContacts = async (req, res, next) => {
// const io = getIO();
// const wbot = getWbot();
// const phoneContacts = await wbot.getContacts();
// return res.status(200).json(phoneContacts);
// };