From 177d9706b88fb15605d861373c73741d508f3d21 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 10 Nov 2025 14:42:51 +0530 Subject: [PATCH] Geetha : uploadProductsFromCSV --- app/controllers/products.controller.js | 2 +- app/routes/routes.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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