diff --git a/api/routes/orders.js b/api/routes/orders.js index aadce9b..74cc984 100644 --- a/api/routes/orders.js +++ b/api/routes/orders.js @@ -42,7 +42,7 @@ router.post("/", (req, res, next) => { }); } const order = new Order({ - _id: mongoose.Types.ObjectId(), + _id: new mongoose.Types.ObjectId(), quantity: req.body.quantity, product: req.body.productId });