Geetha : uploadProductsFromCSV
This commit is contained in:
parent
80d12c068c
commit
177d9706b8
@ -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." });
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user