pug:
each size in product.sizes
input(style="width:1px; height:1px; position:absolute;" type="checkbox" name="size")
label.product__block-size(for="size")= size
Как я обрабатываю POST запрос (добавление в корзину):
router.post('/add', auth, async(req, res) => {
try {
const product = await Product.findById(
req.body.id, req.body.title, req.body.nowPrice, req.body.mainSize,
req.body.article, req.body.sex, req.body.size
);
console.log(req.body.size);
await req.user.addToCart(product);
res.redirect('/cart');
} catch (e) {
console.log(e);
}
})
console.log возвращает undefined. Что не так?