From 39453e791d16e2b099329fbb56e326645448a1e1 Mon Sep 17 00:00:00 2001 From: adriano Date: Tue, 25 Jan 2022 13:25:37 -0300 Subject: [PATCH] =?UTF-8?q?Adapta=C3=A7=C3=A3o=20para=20ura=20funcionar=20?= =?UTF-8?q?com=20op=C3=A7=C3=A3o=20e=20sem=20op=C3=A7=C3=A3o=20e=20identa?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WbotServices/wbotMessageListener.ts | 27 ++++++++++++------- frontend/src/layout/index.js | 2 +- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/backend/src/services/WbotServices/wbotMessageListener.ts b/backend/src/services/WbotServices/wbotMessageListener.ts index 2c74edd..a85e356 100644 --- a/backend/src/services/WbotServices/wbotMessageListener.ts +++ b/backend/src/services/WbotServices/wbotMessageListener.ts @@ -143,23 +143,30 @@ const verifyQueue = async ( const { queues, greetingMessage } = await ShowWhatsAppService(wbot.id!); - if (queues.length === 1) { + /*if (queues.length === 1) { await UpdateTicketService({ ticketData: { queueId: queues[0].id }, ticketId: ticket.id }); return; + }*/ + + + let selectedOption = null; + let choosenQueue = null + + if (queues.length === 1) { + selectedOption = 1; + choosenQueue = queues[+selectedOption - 1]; + } + else{ + selectedOption = msg.body; + choosenQueue = queues[+selectedOption - 1]; } - - console.log('queues.lengthqueues.lengthqueues.lengthqueues.lengthqueues.length: ',queues.length) - - const selectedOption = msg.body; - const choosenQueue = queues[+selectedOption - 1]; - - //apagar essa gambiarra e ativar as 2 linhas acima thuanny - //const selectedOption = 1; - //const choosenQueue = queues[+selectedOption - 1]; + // const selectedOption = msg.body; + // const choosenQueue = queues[+selectedOption - 1]; + if (choosenQueue) { await UpdateTicketService({ diff --git a/frontend/src/layout/index.js b/frontend/src/layout/index.js index e91ce89..6353668 100644 --- a/frontend/src/layout/index.js +++ b/frontend/src/layout/index.js @@ -220,7 +220,7 @@ const LoggedInLayout = ({ children }) => { className={classes.title} > - GRUPO HIT + BETAGROUP {user.id && }