Files
whaticket-community/backend/controllers/whatsapp.js
2020-06-19 08:36:05 -03:00

16 lines
341 B
JavaScript

const Whatsapp = require("../models/Whatsapp");
exports.getSession = async (req, res, next) => {
try {
const dbSession = await Whatsapp.findOne({ where: { id: 1 } });
if (!dbSession) {
return res.status(200).json({ message: "Session not found" });
}
return res.status(200).json(dbSession);
} catch (err) {
next(err);
}
};