Last active
July 15, 2016 18:08
-
-
Save wgottschalk-RMS/de5dfb744f6929623660054a8fa2a020 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
import co from 'co'; | |
app.post("/purchase", (req, res) => { | |
co(function* () { | |
const person = yield user.findOneAsync(req.body); | |
const permissions = yield permissions.findAllAsync(person); | |
if (isAllowed(permissions)) { | |
const confirmNum = yield transaction.processAsync(user); | |
res.send("Your transaction was successful!") | |
} | |
}).catch(err => handleError(err)) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment