SHARE
TWEET

Untitled

a guest Jul 11th, 2019 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const user = await User.create({
  2.             name,
  3.             email,
  4.             password: hash,
  5.         }).then(user => user.createEmployee({
  6.             name,
  7.             cpf,
  8.             rg,
  9.             pis,
  10.             address,
  11.         })).catch(err => console.log(err))
  12.  
  13.         user.password = undefined
  14.  
  15.         return res.send({user, token: generateToken({id: user.id})})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top