Guest User

Untitled

a guest
Jun 5th, 2018
1,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. error: invalid input syntax for integer: "{"email":"email@gmail.com","password":"hashedpasswordhere"}"
  2.  
  3. function User(){
  4. this.save = function(callback) {
  5. pool.connect();
  6.  
  7. pool.query('INSERT INTO users(email, password) VALUES($1, $2) RETURNING *', [this.email, this.password], function (err, result) {
  8. if(err){
  9. console.log(err);
  10. return console.error('error running query', err);
  11. }
  12. var user = result.rows[0]
  13. console.log(user);
  14. return callback(user);
  15. });
  16. };
  17. }
  18.  
  19. { id: 1,
  20. email: 'email@gmail.com',
  21. password: 'hashedpasswordhere' }
  22.  
  23. User {
  24. save: [Function],
  25. email: 'email@gmail.com',
  26. password: 'hashedpasswordhere' }
Add Comment
Please, Sign In to add comment