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,8 +34,11 @@ async function lookupContactByPhone(rest, authentication, crmPhone, companyId, t
console.log("PAYLOAD CONFIG LOOKUP CONTACT BY PHONE CONFIG.url 1: ", config.url)
if(config.url.includes("+")){
config.url = config.url.replace("+", "")
// Para consultar contato crm SAP, necessário consultar sem sinal de + no inicio numero
const pattern = /%2B\+/g;
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)