chore: Added companyId 12928 to ignore automatic ticket creation
parent
f601dbb699
commit
3e204da937
|
@ -119,8 +119,11 @@ const callJournaling = async (req, res) => {
|
||||||
console.log('update-answer')
|
console.log('update-answer')
|
||||||
|
|
||||||
// Referente a cliente a gabriel, pois os tickets estao sendo abertos diretamente em um botao do hitphone
|
// Referente a cliente a gabriel, pois os tickets estao sendo abertos diretamente em um botao do hitphone
|
||||||
// if (companyId != "14223")
|
if (companyId != "12928") {
|
||||||
|
console.log(`################## CRIAÇÃO AUTOMATICA DE TICKET COMPANY ID ${companyId} ##################`)
|
||||||
await ticketCRM(companyId, crmPhone, crmAgent, crmFirstName)
|
await ticketCRM(companyId, crmPhone, crmAgent, crmFirstName)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const resp = await redirectContactLinkCRM(companyId, crmPhone, crmAgent, crmFirstName)
|
const resp = await redirectContactLinkCRM(companyId, crmPhone, crmAgent, crmFirstName)
|
||||||
return res.status(StatusCodes.OK).json({ contact: resp })
|
return res.status(StatusCodes.OK).json({ contact: resp })
|
||||||
|
@ -377,7 +380,15 @@ const createTicket = async (req, res) => {
|
||||||
|
|
||||||
mustContainProperties(req, ['companyId', 'crmPhone'])
|
mustContainProperties(req, ['companyId', 'crmPhone'])
|
||||||
|
|
||||||
const crmTicketLinks = await ticketCRM(companyId, crmPhone)
|
const crmTicketLinks = await ticketCRM(companyId, crmPhone).catch(function (error) {
|
||||||
|
|
||||||
|
console.error(`Error on create ticket: companyID ${companyId} | crmPhone: ${crmPhone}`)
|
||||||
|
console.error(error?.response?.data)
|
||||||
|
console.error(error?.response?.status)
|
||||||
|
console.error(error?.response?.headers)
|
||||||
|
|
||||||
|
throw new Error(`Error on create ticket: companyID ${companyId} | crmPhone: ${crmPhone}`)
|
||||||
|
})
|
||||||
|
|
||||||
return res.status(StatusCodes.OK).json({ crmTicketLinks })
|
return res.status(StatusCodes.OK).json({ crmTicketLinks })
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,9 @@ async function ticketCRM(companyId, crmPhone, crmAgent="0000", crmFirstName = 'U
|
||||||
obj_ticket.ticketId
|
obj_ticket.ticketId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (obj_ticket_status)
|
||||||
|
console.log("obj_ticket_status: ", JSON.stringify(obj_ticket_status, null, 6))
|
||||||
|
|
||||||
if (obj_ticket_status) {
|
if (obj_ticket_status) {
|
||||||
const { auxTicketStatus, error } = obj_ticket_status
|
const { auxTicketStatus, error } = obj_ticket_status
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue