fix: implemented solution to solve lookup contact sap

master
adriano 2025-10-13 11:26:44 -03:00
parent 5b57300b16
commit ebe4f901f7
1 changed files with 7 additions and 4 deletions

View File

@ -34,11 +34,14 @@ async function lookupContactByPhone(rest, authentication, crmPhone, companyId, t
console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE CONFIG.url 1: ", config.url) console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE CONFIG.url 1: ", config.url)
if(config.url.includes("+")){ // Para consultar contato crm SAP, necessário consultar sem sinal de + no inicio numero
config.url = config.url.replace("+", "") const pattern = /%2B\+/g;
}
console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE CONFIG.url 2: ", config.url) if (pattern.test(config.url)){
config.url = config.url.replace(/%2B\+/g, '%2B');
}
console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE CONFIG.url 2: ", config.url)
console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE: ", JSON.stringify(config, null, 6)) console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE: ", JSON.stringify(config, null, 6))