attached product sample file
This commit is contained in:
parent
acf9a83558
commit
bc9eae418b
@ -269,7 +269,7 @@ exports.deleteProduct = async (req, res) => {
|
||||
|
||||
exports.downloadProductSample = async (req, res) => {
|
||||
try {
|
||||
const filePath = path.join(__dirname, "../writable/uploads/sample_files/products_upload_sample.csv");
|
||||
const filePath = path.join(__dirname, "../writable/uploads/products_upload_sample.csv");
|
||||
return res.download(filePath, "products_upload_sample.csv");
|
||||
} catch (error) {
|
||||
return res.status(500).send({ status: "failed", message: error.message });
|
||||
|
||||
@ -1182,6 +1182,9 @@ router.post("/products/uploadCSV",[ verifySignature, verifyToken, upload.single(
|
||||
* get:
|
||||
* summary: Download sample CSV template for bulk product upload
|
||||
* tags: [Products]
|
||||
* security:
|
||||
* - appSignature: []
|
||||
* - bearerAuth: []
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Sample CSV file downloaded successfully
|
||||
@ -1195,7 +1198,7 @@ router.post("/products/uploadCSV",[ verifySignature, verifyToken, upload.single(
|
||||
* 500:
|
||||
* description: Server error
|
||||
*/
|
||||
router.get("/download-sample-product-upload-file",[verifySignature, verifyToken], productController.downloadProductSample);
|
||||
router.get("/products/download-sample",[verifySignature, verifyToken], productController.downloadProductSample);
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user