From 7a07606a49afccf13dcea2e5f6b82e0562465767 Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Mon, 1 Jul 2024 16:40:20 -0300 Subject: [PATCH] prettier --- .../src/helpers/SetTicketMessagesAsRead.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/helpers/SetTicketMessagesAsRead.ts b/backend/src/helpers/SetTicketMessagesAsRead.ts index 0b6b7baa..dd384cbf 100644 --- a/backend/src/helpers/SetTicketMessagesAsRead.ts +++ b/backend/src/helpers/SetTicketMessagesAsRead.ts @@ -31,11 +31,15 @@ const SetTicketMessagesAsRead = async (ticket: Ticket): Promise => { }); if (getJsonMessage.length > 0) { - const lastMessages: proto.IWebMessageInfo = JSON.parse( getJsonMessage[0].dataJson ); + const lastMessages: proto.IWebMessageInfo = JSON.parse( + getJsonMessage[0].dataJson + ); if (lastMessages.key && lastMessages.key.fromMe === false) { await (wbot as WASocket).chatModify( { markRead: true, lastMessages: [lastMessages] }, - `${ticket.contact.number}@${ticket.isGroup ? "g.us" : "s.whatsapp.net"}` + `${ticket.contact.number}@${ + ticket.isGroup ? "g.us" : "s.whatsapp.net" + }` ); } } @@ -57,11 +61,14 @@ const SetTicketMessagesAsRead = async (ticket: Ticket): Promise => { } const io = getIO(); - if (companyid){ - io.to(`company-${companyid}-mainchannel`).emit(`company-${companyid}-ticket`, { - action: "updateUnread", - ticketId: ticket?.id - }); + if (companyid) { + io.to(`company-${companyid}-mainchannel`).emit( + `company-${companyid}-ticket`, + { + action: "updateUnread", + ticketId: ticket?.id + } + ); } io.to(ticket.status).to("notification").emit("ticket", {