Commit e3ccc53a authored by Gabriel's avatar Gabriel

Quita operador de optional chaining

parent 7df77577
......@@ -18,7 +18,7 @@ async function saveContactToList(email, nombres, apellidos, sms, listId){
addContactToList(email, listId);
})
.catch(function (error) {
console.log(`Error al crear/actualizar usuario en sendinblue: ${JSON.stringify(error?.response?.data)}`);
console.log(`Error al crear/actualizar usuario en sendinblue: ${JSON.stringify(error.response.data)}`);
});
}
......@@ -39,8 +39,8 @@ async function createOrUpdateContact(email, nombres, apellidos, sms){
return response.data;
})
.catch(async function (error) {
if(error?.response?.data?.code === ERROR_CODE_DUPLICATE_PARAMETER){
console.log(error?.response?.data)
if(error.response.data.code === ERROR_CODE_DUPLICATE_PARAMETER){
console.log(error.response.data)
return await sendinblueClient.put(encodeURI(`/contacts/${email}`), {
"attributes": {
"NOMBRE": nombres,
......@@ -64,7 +64,7 @@ async function addContactToList(email, listId){
return response.data;
})
.catch(async function (error) {
console.log(`Error al agregar al usuario ${email} a la lista ${listId}: ${JSON.stringify(error?.response?.data)}`);
console.log(`Error al agregar al usuario ${email} a la lista ${listId}: ${JSON.stringify(error.response.data)}`);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment