Fix file excel

This commit is contained in:
Hou Samnang 2021-03-31 18:08:19 +07:00
parent e5f439bffd
commit 322b18487b
2 changed files with 1 additions and 1 deletions

Binary file not shown.

View File

@ -40,7 +40,7 @@ app.post('/upload', async function (req, res) {
let input = req.body.myFile;
let wb = XLSX.read(input, { type: 'binary' });
let xlData = XLSX.utils.sheet_to_json(wb.Sheets['Sheet2']);
let xlData = XLSX.utils.sheet_to_json(wb.Sheets['Sheet1']);
let data = xlData.map((row) => ({ productName: row['Product name'], smallTypeName: row.SmallTypeName, productCategory: { productCategoryId: row['CategoryID'], newCategory: row['Category'] }, alert: row.alert, cost: row.cost, qtyStock: row.qtystock, sellPrice: row.sellPrice }))
res.send(data)