#17 Revisión cuando un contacto ya existe incluirlo en la lista
This commit is contained in:
parent
67afb9734c
commit
040808c4b4
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user