Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!isValid) {
- return res.status(400).json(errors);
- }
- User.findOne({ email: req.body.email }).then(user => {
- if (user) {
- return res.status(400).json({ email: "Email already exists" });
- } else {
- const newUser = new User({
- first_name: req.body.first_name,
- last_name: req.body.last_name,
- email: req.body.email,
- password: req.body.password
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement