From 5bf6f37330dc2de2ed7a98908ef537397d270fec Mon Sep 17 00:00:00 2001 From: sriramv Date: Thu, 3 Aug 2023 11:02:39 +0530 Subject: [PATCH] entity_type --- app/controllers/excel.controller.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/excel.controller.js b/app/controllers/excel.controller.js index ed4c832..b4f6964 100644 --- a/app/controllers/excel.controller.js +++ b/app/controllers/excel.controller.js @@ -27,8 +27,13 @@ exports.ImportExcelData = async (req, res , filename) => const resultArray = []; if(SheetLevelData.length != 0) { - - EntityData = await Entities.findOne({raw:true, where: { losid : losid , cin : sheetName } }).catch(err => {}); + if(sheetName.toUpperCase() == 'PROPRIETORSHIP'){ + where_Condition = { losid : losid , entity_type : 'PROPRIETORSHIP' } + }else{ + where_Condition = { losid : losid , cin : sheetName } + } + + EntityData = await Entities.findOne({raw:true, where: where_Condition }).catch(err => {}); if(EntityData) { for (const obj of SheetLevelData)