Skip to content

Instantly share code, notes, and snippets.

@blakmatrix
Created April 27, 2014 04:03
Show Gist options
  • Save blakmatrix/11337312 to your computer and use it in GitHub Desktop.
Save blakmatrix/11337312 to your computer and use it in GitHub Desktop.
/* ========================== user.create =========================== */
UserModel.prototype.create = function (request, reply, callback) {
var query = user.insert(request.payload).toQuery();
request.postgres.client.query(query.text, query.values, function(err, result) {
if(err) {
console.dir(err);
return callback(Hapi.error.badRequest(err));
}
callback(null, result);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment