attached product sample file

This commit is contained in:
unknown 2025-12-01 16:12:42 +05:30
parent acf9a83558
commit bc9eae418b
2 changed files with 5 additions and 2 deletions

View File

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

View File

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