Created
November 28, 2016 08:42
-
-
Save kamaulynder/2b9f410b919238fe3f1fd2dba57f462f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
done() { | |
this.peopleEndpoint.addMember( | |
{orgId: this.user.organizations[0].id}, | |
{name: this.member, | |
email: this.email, | |
phone: this.phone, | |
description: this.member_description} | |
).$promise | |
.then((response) => { | |
this.new_member = response.user; | |
this.contactsEndpoint.addContact( | |
{user_id: this.new_member.id}, | |
{contact: this.email} | |
).$promise | |
.then((response) => { | |
this.member_contact = response.contact; | |
}, function error(){ | |
this.member_contact = "error adding contact" | |
}); | |
}, function error(){ | |
this.new_member = "error adding new member" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment