Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. exports.create = (req, res) => {
  2.  
  3. const user = new User({
  4. name: req.body.name,
  5. surname: req.body.surname,
  6. username: req.body.username,
  7. password: req.body.password,
  8. passwordConf: req.body.passwordConf
  9. });
  10.  
  11. user.save()
  12. .then(data => {
  13. res.send(data);
  14. }).catch(err => {
  15. res.status(500).send({
  16. message: err.message || "Wystapil jakis blad podczas tworzenia uzytkownika!"
  17. });
  18. });
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement