Skip to content

Instantly share code, notes, and snippets.

@binhqd
Created December 22, 2016 04:05
Show Gist options
  • Save binhqd/6e54eda82d3ffe7ddd29c2fa13fef8ec to your computer and use it in GitHub Desktop.
Save binhqd/6e54eda82d3ffe7ddd29c2fa13fef8ec to your computer and use it in GitHub Desktop.
const InvitationHelper = require('../InvitationHelpers');
self.customCreate = (data, fn) => {
return findUser()
.then(InvitationHelpers.checkParams)
.then(InvitationHelpers.checkIsInSP)
.then(InvitationHelpers.checkIsInvited)
.then(InvitationHelpers.createInvitation)
.then(InvitationHelpers.queueEmail)
.then((invitation) => {
fn(null, invitation);
})
.catch(fn);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment