diff --git a/app/controllers/products.controller.js b/app/controllers/products.controller.js index 2cd5452..e481410 100644 --- a/app/controllers/products.controller.js +++ b/app/controllers/products.controller.js @@ -240,7 +240,7 @@ exports.uploadProductsFromCSV = async (req, res) => { return res.status(400).send({ status: "failed", message: "Invalid file type. Only CSV allowed." }); } - if (!req.body.userId || isNaN(req.body.userId)) { + if (!req.body.created_by || isNaN(req.body.created_by)) { fs.unlinkSync(filePath); return res.status(400).send({ status: "failed", message: "Invalid or missing userId." }); } diff --git a/app/routes/routes.js b/app/routes/routes.js index 931b269..8a7c338 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -1157,6 +1157,9 @@ router.delete("/products/:id",[verifySignature, verifyToken], productController. * type: string * format: binary * description: CSV file to upload + * created_by: + * type: integer + * description: ID of the user performing the upload * responses: * 201: * description: Products uploaded successfully