From c4051f3c9ac1e66329555293238f9450db082e2d Mon Sep 17 00:00:00 2001 From: sriramv Date: Wed, 2 Feb 2022 16:05:02 +0530 Subject: [PATCH] merge:GWM --- app/controllers/financial.controller.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/financial.controller.js b/app/controllers/financial.controller.js index 26d4a07..d4cae87 100644 --- a/app/controllers/financial.controller.js +++ b/app/controllers/financial.controller.js @@ -672,27 +672,28 @@ exports.refreshApi = (req, res) => { financials_data_api_response.then(function(result){ if(result == false) { - // create skeleton here - //financialControllerHelper.createSkeleton(losid,entityid); + res.status(500).send({'status':500,message: "Failed" ,'data': "No data for this cin number from probe42" }); } else { //filter lineitems from api responce and construct to needed format lineItem_data = Probe42DataMappingHelper.lineItemFetching(result); lineItem_data.then(function(lineItem_result){ - console.log(lineItem_result) + //create financial table and entityfinyear table record here lineItem_result.forEach((value, key)=>{ - //line item data update + // mapping of probe42 api lineItem with itemMaster primary key final_array = Probe42DataMappingHelper.lineItemMapping(value,entityid); final_array.then(function(update_array_data){ - console.log(update_array_data) + // update mapped lineitem value here - //Probe42DataMappingHelper.lineItemUpdate(update_array_data); + Probe42DataMappingHelper.lineItemUpdate(update_array_data); });//end of lineItemUpdate helper call });//end of line item foreach + + setTimeout(() => { res.status(200).send({'status':200,message: "success" ,'data': "No data" }); }, 5000);