Correção para quando transferir atendimento

adriano 2023-06-30 15:21:30 -03:00
parent 64cd155016
commit 605e4035b9
2 changed files with 15 additions and 6 deletions

View File

@ -45,6 +45,7 @@ interface TicketData {
userId: number;
whatsappId?: string | number
msg?: string,
transfer?: boolean | undefined
}
@ -226,6 +227,11 @@ export const update = async (req: Request, res: Response): Promise<Response> =>
let ticketData: TicketData = req.body;
console.log('ticketData: ', ticketData)
console.log('ticketData.transfer', ticketData.transfer)
if (ticketData.transfer) {
const defaultWhatsapp: any = await GetDefaultWhatsApp(ticketData.userId);
const _ticket: any = await Ticket.findByPk(ticketId)
@ -238,6 +244,8 @@ export const update = async (req: Request, res: Response): Promise<Response> =>
ticketData.whatsappId = defaultWhatsapp.dataValues.id
}
const { ticket } = await UpdateTicketService({
ticketData,
ticketId,

View File

@ -109,6 +109,7 @@ const TransferTicketModal = ({ modalOpen, onClose, ticketid }) => {
// test del PARA APARECER NA FILA DE OUTRO ATENDENTE E O MESMO CLICAR EM ACEITAR AO INVES DE ENVIAR PARA ATENDENDO
data.status = 'pending'
data.transfer = true
await api.put(`/tickets/${ticketid}`, data);