Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. if (!isValid) {
  2. return res.status(400).json(errors);
  3. }
  4.  
  5. User.findOne({ email: req.body.email }).then(user => {
  6. if (user) {
  7. return res.status(400).json({ email: "Email already exists" });
  8. } else {
  9. const newUser = new User({
  10. first_name: req.body.first_name,
  11. last_name: req.body.last_name,
  12. email: req.body.email,
  13. password: req.body.password
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement