Skip to content

Instantly share code, notes, and snippets.

@wgottschalk-RMS
Last active July 15, 2016 18:08
Show Gist options
  • Save wgottschalk-RMS/de5dfb744f6929623660054a8fa2a020 to your computer and use it in GitHub Desktop.
Save wgottschalk-RMS/de5dfb744f6929623660054a8fa2a020 to your computer and use it in GitHub Desktop.
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