fix: implemented solution to solve lookup contact sap
parent
5b57300b16
commit
ebe4f901f7
|
|
@ -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))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue