Last active
July 1, 2016 02:49
-
-
Save wgottschalk-RMS/2ba033c04872069d1437858290daebec 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
app.post("/purchase", (req, res) => { | |
user.findOneAsync(req.body) | |
.then( userData => { | |
return permissions | |
.findAllAsync(userData) | |
.then( permissions => { | |
if (isAllowed(permissions)) { | |
return transaction.processAsync(userData); | |
} | |
}); | |
}) | |
.then( confirmNum => res.send("Your purchase was successful!")) | |
.catch( err => handleError(err) ) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment