code cleanup

This commit is contained in:
canove
2020-09-22 10:18:38 -03:00
parent 48dbf7e859
commit 6bc3b216c8
21 changed files with 12 additions and 1276 deletions

View File

@@ -1,11 +1,9 @@
import { getIO } from "../libs/socket";
import { getWbot } from "../libs/wbot";
import Message from "../models/Message";
import Ticket from "../models/Ticket";
import GetTicketWbot from "./GetTicketWbot";
const SetTicketMessagesAsRead = async (ticket: Ticket): Promise<void> => {
const wbot = getWbot(ticket.whatsappId);
await Message.update(
{ read: true },
{
@@ -17,6 +15,7 @@ const SetTicketMessagesAsRead = async (ticket: Ticket): Promise<void> => {
);
try {
const wbot = await GetTicketWbot(ticket);
await wbot.sendSeen(`${ticket.contact.number}@c.us`);
} catch (err) {
console.log(