Geetha : uploadProductsFromCSV

This commit is contained in:
Gowtham M 2025-11-10 14:42:51 +05:30
parent 80d12c068c
commit 177d9706b8
2 changed files with 4 additions and 1 deletions

View File

@ -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." });
}

View File

@ -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