Guest User

Untitled

a guest
Feb 16th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. UnhandledPromiseRejectionWarning: TypeError: res is not a function
  2. [0] at newInput.save.then.catch.err (C:UsersAlexDesktopNodenodeServerroutesapiinputsAPI.js:25:19)
  3. [0] at process._tickCallback (internal/process/next_tick.js:68:7)
  4.  
  5. router.post('/', (req, res) => {
  6. const newInput = new Input({
  7. inputs: req.body.inputs,
  8. formName: req.body.formName
  9. });
  10.  
  11. newInput
  12. .save()
  13. .then(() => res.json(`The inputs were submitted successfully`))
  14. .catch(err => res('new input error: ', err));
  15. });
Add Comment
Please, Sign In to add comment