Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UnhandledPromiseRejectionWarning: TypeError: res is not a function
- [0] at newInput.save.then.catch.err (C:UsersAlexDesktopNodenodeServerroutesapiinputsAPI.js:25:19)
- [0] at process._tickCallback (internal/process/next_tick.js:68:7)
- router.post('/', (req, res) => {
- const newInput = new Input({
- inputs: req.body.inputs,
- formName: req.body.formName
- });
- newInput
- .save()
- .then(() => res.json(`The inputs were submitted successfully`))
- .catch(err => res('new input error: ', err));
- });
Add Comment
Please, Sign In to add comment