#17 Revisión cuando un contacto ya existe incluirlo en la lista

This commit is contained in:
David Arranz 2020-11-17 10:48:31 +01:00
parent 67afb9734c
commit 040808c4b4

View File

@ -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() {