From 040808c4b42f207abf84ca35efbc898616ad4567 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 17 Nov 2020 10:48:31 +0100 Subject: [PATCH] =?UTF-8?q?#17=20Revisi=C3=B3n=20cuando=20un=20contacto=20?= =?UTF-8?q?ya=20existe=20incluirlo=20en=20la=20lista?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helpers/sendinblue.helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/sendinblue.helper.js b/helpers/sendinblue.helper.js index a93f35b..64b74a3 100644 --- a/helpers/sendinblue.helper.js +++ b/helpers/sendinblue.helper.js @@ -35,7 +35,7 @@ function _createMember(member) { api.createContact(createContact) .then(function (data) { console.debug('API called successfully. Returned data: ' + data); - if (data.id) { + if (data && data.id) { // Se ha dado de alta el contacto porque no existía createContact.ID = data.id; } @@ -116,6 +116,7 @@ function addMember(listId, member) { return new Promise(function (resolve, reject) { _createMember(member) .then(function(contact) { + console.debug('añadir a lista: ' + listId + ' * ' + contact); return _addMemberToList(contact, listId); }) .then(function() {