Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: invalid input syntax for integer: "{"email":"email@gmail.com","password":"hashedpasswordhere"}"
- function User(){
- this.save = function(callback) {
- pool.connect();
- pool.query('INSERT INTO users(email, password) VALUES($1, $2) RETURNING *', [this.email, this.password], function (err, result) {
- if(err){
- console.log(err);
- return console.error('error running query', err);
- }
- var user = result.rows[0]
- console.log(user);
- return callback(user);
- });
- };
- }
- { id: 1,
- email: 'email@gmail.com',
- password: 'hashedpasswordhere' }
- User {
- save: [Function],
- email: 'email@gmail.com',
- password: 'hashedpasswordhere' }
Add Comment
Please, Sign In to add comment