-
-
Save ademidoff/1add6b8d7eb1e3935217c182fea50021 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