mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
Add Feat. Farewell Message
This commit is contained in:
@@ -2,6 +2,8 @@ import CheckContactOpenTickets from "../../helpers/CheckContactOpenTickets";
|
||||
import SetTicketMessagesAsRead from "../../helpers/SetTicketMessagesAsRead";
|
||||
import { getIO } from "../../libs/socket";
|
||||
import Ticket from "../../models/Ticket";
|
||||
import SendWhatsAppMessage from "../WbotServices/SendWhatsAppMessage";
|
||||
import ShowWhatsAppService from "../WhatsappService/ShowWhatsAppService";
|
||||
import ShowTicketService from "./ShowTicketService";
|
||||
|
||||
interface TicketData {
|
||||
@@ -28,7 +30,6 @@ const UpdateTicketService = async ({
|
||||
const { status, userId, queueId } = ticketData;
|
||||
|
||||
const ticket = await ShowTicketService(ticketId);
|
||||
|
||||
await SetTicketMessagesAsRead(ticket);
|
||||
|
||||
const oldStatus = ticket.status;
|
||||
@@ -44,6 +45,8 @@ const UpdateTicketService = async ({
|
||||
userId
|
||||
});
|
||||
|
||||
|
||||
|
||||
await ticket.reload();
|
||||
|
||||
const io = getIO();
|
||||
@@ -55,6 +58,8 @@ const UpdateTicketService = async ({
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
io.to(ticket.status)
|
||||
.to("notification")
|
||||
.to(ticketId.toString())
|
||||
|
||||
Reference in New Issue
Block a user