Unit master bug fixed
This commit is contained in:
parent
51a2c81e42
commit
8214219320
@ -4,6 +4,7 @@ const { Sequelize } = require("sequelize");
|
||||
const { UnitMaster } = require("../models");
|
||||
const fs = require("fs");
|
||||
const csv = require("csv-parser");
|
||||
const path = require("path");
|
||||
|
||||
// Create new Unit
|
||||
exports.createUnit = async (req, res) => {
|
||||
@ -439,7 +440,7 @@ exports.uploadUnitMasterFromCSV = async (req, res) => {
|
||||
}
|
||||
};
|
||||
|
||||
exports.downloadUnitMasterSample = async (req, res) => {
|
||||
exports.downloadUnitMasterFile = async (req, res) => {
|
||||
try {
|
||||
const filePath = path.join(__dirname, "../uploads/unit_master_sample.csv");
|
||||
return res.download(filePath, "unit_master_sample.csv");
|
||||
|
||||
@ -2820,7 +2820,7 @@ router.get("/establishment/download-sample-file",[verifySignature, verifyToken],
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/unit_master/download_sample_file:
|
||||
* /api/unit_master_download_sample_file:
|
||||
* get:
|
||||
* summary: Download sample CSV template for bulk Unit Master upload
|
||||
* tags: [Products]
|
||||
@ -2840,7 +2840,8 @@ router.get("/establishment/download-sample-file",[verifySignature, verifyToken],
|
||||
* 500:
|
||||
* description: Server error
|
||||
*/
|
||||
router.get("/unit_master/download_sample_file",[verifySignature, verifyToken], unitMasterController.downloadUnitMasterSample);
|
||||
router.get("/unit_master_download_sample_file",[verifySignature, verifyToken], unitMasterController.downloadUnitMasterFile);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user