From 74f3459e65e0cc11041b4506ec145abc676493f1 Mon Sep 17 00:00:00 2001 From: sriramv Date: Thu, 10 Aug 2023 13:29:51 +0530 Subject: [PATCH] excel:GWM --- app/controllers/excel.controller.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/excel.controller.js b/app/controllers/excel.controller.js index 50ad8f5..73f77b2 100644 --- a/app/controllers/excel.controller.js +++ b/app/controllers/excel.controller.js @@ -93,9 +93,10 @@ exports.ImportExcelData = async (req, res , filename) => }); }); FinancialsDataUpdate.then(async(data)=> - { - data.forEach(async(value, key , array)=>{ - var entity_id = value[0].entity_id; + { + const filteredData = data.filter(subArray => subArray.length > 0); + filteredData.forEach(async(value, key , array)=>{ + var entity_id = value[0]['entity_id']; await Financials.update( {manual_data_status:1},{where:{id:entity_id}} ).catch(err=>{ logMsg.info(err); }); }); res.send({'status':200,'message':"success",'data':"No data"});