Skip to content

Instantly share code, notes, and snippets.

@kamaulynder
Created November 28, 2016 08:42
Show Gist options
  • Save kamaulynder/2b9f410b919238fe3f1fd2dba57f462f to your computer and use it in GitHub Desktop.
Save kamaulynder/2b9f410b919238fe3f1fd2dba57f462f to your computer and use it in GitHub Desktop.
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