mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
All models using classes and sequelize migrations
This commit is contained in:
23
backend/src/controllers/WhatsAppSessionController.js
Normal file
23
backend/src/controllers/WhatsAppSessionController.js
Normal 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);
|
||||
// };
|
||||
Reference in New Issue
Block a user