feat: if theres only one queue on whatsapp, assign tickets to this queue

This commit is contained in:
canove
2021-01-14 21:21:20 -03:00
parent 7b4f38965e
commit 964ed649d7
2 changed files with 5 additions and 2 deletions

View File

@@ -138,7 +138,6 @@ const verifyQueue = async (
const { queues, greetingMessage } = await ShowWhatsAppService(wbot.id!);
if (queues.length === 1) {
// await ticket.$set("queue", queues[0].id);
await UpdateTicketService({
ticketData: { queueId: queues[0].id },
ticketId: ticket.id
@@ -267,7 +266,7 @@ const handleMessage = async (
!chat.isGroup &&
!msg.fromMe &&
!ticket.userId &&
whatsapp.queues.length > 1
whatsapp.queues.length >= 1
) {
await verifyQueue(wbot, msg, ticket, contact);
}