-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
in routes:
router.post('/api/polls/:pID/new', (req, res, next) => {
req.poll.answers.push(req.body);
req.poll.save((err, doc) => {
if (err) return next(err);
return res.status(201).json(doc);
});
});it should be something like (but not working):
router.post('/api/polls/:pID/new', (req, res, next) => {
req.poll.answers.concat(req.body);
req.poll.save((err, doc) => {
if (err) return next(err);
return res.status(201).json(doc);
});
});