improvement: remove tickets logic from useTickets to improve notifications

This commit is contained in:
canove
2020-09-25 18:53:14 -03:00
parent c7d3807219
commit 5396837db4
10 changed files with 190 additions and 163 deletions

View File

@@ -138,12 +138,15 @@ const handleMessage = async (
}
const io = getIO();
io.to(ticket.id.toString()).to("notification").emit("appMessage", {
action: "create",
message: newMessage,
ticket,
contact
});
io.to(ticket.id.toString())
.to(ticket.status)
.to("notification")
.emit("appMessage", {
action: "create",
message: newMessage,
ticket,
contact
});
};
const isValidMsg = (msg: WbotMessage): boolean => {