Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

currently only one answer can be added #68

Open
Createdd opened this issue Aug 2, 2017 · 0 comments
Open

currently only one answer can be added #68

Createdd opened this issue Aug 2, 2017 · 0 comments

Comments

@Createdd
Copy link
Owner

Createdd commented Aug 2, 2017

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);
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant