mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +00:00
feat: if theres only one queue on whatsapp, assign tickets to this queue
This commit is contained in:
@@ -138,7 +138,6 @@ const verifyQueue = async (
|
|||||||
const { queues, greetingMessage } = await ShowWhatsAppService(wbot.id!);
|
const { queues, greetingMessage } = await ShowWhatsAppService(wbot.id!);
|
||||||
|
|
||||||
if (queues.length === 1) {
|
if (queues.length === 1) {
|
||||||
// await ticket.$set("queue", queues[0].id);
|
|
||||||
await UpdateTicketService({
|
await UpdateTicketService({
|
||||||
ticketData: { queueId: queues[0].id },
|
ticketData: { queueId: queues[0].id },
|
||||||
ticketId: ticket.id
|
ticketId: ticket.id
|
||||||
@@ -267,7 +266,7 @@ const handleMessage = async (
|
|||||||
!chat.isGroup &&
|
!chat.isGroup &&
|
||||||
!msg.fromMe &&
|
!msg.fromMe &&
|
||||||
!ticket.userId &&
|
!ticket.userId &&
|
||||||
whatsapp.queues.length > 1
|
whatsapp.queues.length >= 1
|
||||||
) {
|
) {
|
||||||
await verifyQueue(wbot, msg, ticket, contact);
|
await verifyQueue(wbot, msg, ticket, contact);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,6 +389,10 @@ const messages = {
|
|||||||
ERR_CREATING_TICKET: "Error while creating ticket on database.",
|
ERR_CREATING_TICKET: "Error while creating ticket on database.",
|
||||||
ERR_FETCH_WAPP_MSG:
|
ERR_FETCH_WAPP_MSG:
|
||||||
"Error fetching the message in WhtasApp, maybe it is too old.",
|
"Error fetching the message in WhtasApp, maybe it is too old.",
|
||||||
|
ERR_QUEUE_COLOR_ALREADY_EXISTS:
|
||||||
|
"This color is already in use, pick another one.",
|
||||||
|
ERR_WAPP_GREETING_REQUIRED:
|
||||||
|
"Greeting message is required if there is more than one queue.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user