Skip to content

currently only one answer can be added #68

@Createdd

Description

@Createdd

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);
  });
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions