Created
April 27, 2014 04:03
-
-
Save blakmatrix/11337312 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
/* ========================== 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