mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
feat: finished multiple whatsapps handle in frontend
This commit is contained in:
@@ -60,11 +60,11 @@ const startWhatsAppSessions = async () => {
|
||||
const whatsapps = await Whatsapp.findAll();
|
||||
|
||||
if (whatsapps.length > 0) {
|
||||
whatsapps.forEach(dbSession => {
|
||||
initWbot(dbSession)
|
||||
whatsapps.forEach(whatsapp => {
|
||||
initWbot(whatsapp)
|
||||
.then(() => {
|
||||
wbotMessageListener(dbSession);
|
||||
wbotMonitor(dbSession);
|
||||
wbotMessageListener(whatsapp);
|
||||
wbotMonitor(whatsapp);
|
||||
})
|
||||
.catch(err => console.log(err));
|
||||
});
|
||||
@@ -72,14 +72,6 @@ const startWhatsAppSessions = async () => {
|
||||
};
|
||||
startWhatsAppSessions();
|
||||
|
||||
// wBot
|
||||
// .init()
|
||||
// .then(({ dbSession }) => {
|
||||
// wbotMessageListener();
|
||||
// wbotMonitor(dbSession);
|
||||
// })
|
||||
// .catch(err => console.log(err));
|
||||
|
||||
app.use(Sentry.Handlers.errorHandler());
|
||||
|
||||
app.use(async (err, req, res, next) => {
|
||||
@@ -88,5 +80,6 @@ app.use(async (err, req, res, next) => {
|
||||
console.log(err);
|
||||
return res.status(500).json(errors);
|
||||
}
|
||||
|
||||
return res.status(500).json({ error: "Internal server error" });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user