Commit c1d8eb7d authored by Gabriel's avatar Gabriel

Edita manejo de error en sendinblue

parent b4325415
...@@ -40,7 +40,6 @@ async function createOrUpdateContact(email, nombres, apellidos, sms){ ...@@ -40,7 +40,6 @@ async function createOrUpdateContact(email, nombres, apellidos, sms){
}) })
.catch(async function (error) { .catch(async function (error) {
if(error.response.data.code === ERROR_CODE_DUPLICATE_PARAMETER){ if(error.response.data.code === ERROR_CODE_DUPLICATE_PARAMETER){
console.log(error.response.data)
return await sendinblueClient.put(encodeURI(`/contacts/${email}`), { return await sendinblueClient.put(encodeURI(`/contacts/${email}`), {
"attributes": { "attributes": {
"NOMBRE": nombres, "NOMBRE": nombres,
...@@ -52,6 +51,9 @@ async function createOrUpdateContact(email, nombres, apellidos, sms){ ...@@ -52,6 +51,9 @@ async function createOrUpdateContact(email, nombres, apellidos, sms){
return response.data; return response.data;
}) })
} }
else{
return error;
}
}); });
} }
......
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