fin_info_table_error:GWM
This commit is contained in:
parent
c414b9bf69
commit
ea1ac0e7c2
@ -40,8 +40,8 @@ exports.PullCreditPdData = async (req, res) => {
|
||||
CreditGeneralBusinessInformation.destroy({ where : { pd_id : CreditGeneralInformationDataExist.dataValues.pd_id}});
|
||||
SupplierDetail.destroy({ where : { pd_id : CreditGeneralInformationDataExist.dataValues.pd_id}});
|
||||
}).catch(err=>{logMsg.info("GeneralInformation Deletion failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
||||
// res.send({'status':200, 'message': "data already exist." ,'data': "No data" });
|
||||
// logMsg.info("CreditGeneralInformation data already exist.,PdId(ref_no)= "+req.body.pdid);
|
||||
// res.send({'status':200, 'message': "data already exist." ,'data': "No data" });
|
||||
// logMsg.info("CreditGeneralInformation data already exist.,PdId(ref_no)= "+req.body.pdid);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -96,10 +96,12 @@ exports.PullCreditPdData = async (req, res) => {
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ObjectValue == "" && OverallKey == "Financial Information"){ delete OverallValue[ObjectKey]; }
|
||||
else {
|
||||
Object.assign(obj, { [ObjectKey]: ObjectValue });
|
||||
if (OverallKey == "Borrower & Guarantor Details" && ObjectKey == "common_remarks") { Object.assign(GenInfoObj,{remarks : ObjectValue}) };
|
||||
if (OverallKey == "Loan details" && ObjectKey == "loan_amount") { Object.assign(GenInfoObj,{loan_amount : ObjectValue}) };
|
||||
if (OverallKey == "Officer Details") { Object.assign(GenInfoObj,{[ObjectKey] : ObjectValue}) };
|
||||
if (OverallKey == "Officer Details") { Object.assign(GenInfoObj,{[ObjectKey] : ObjectValue}) };}
|
||||
}
|
||||
}
|
||||
// DB Insertion
|
||||
|
||||
@ -39,9 +39,11 @@ catch (error) {
|
||||
async function OBJECT(OverAllobject , objectKey , ParticularObj) {
|
||||
try
|
||||
{
|
||||
|
||||
const DumpObject = {"address_type" : "address_type" , "pd_locality" : "locality_name", "pd_location" : "description" , "comment_locality" : "rating" , "relationship" : "name" , "company_relation" : "name"} ;
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
// if(OverAllobject[objectKey] == ""){delete OverAllobject[objectKey];}
|
||||
Objkey = DumpObject[objectKey];
|
||||
Object.assign(OverAllobject , { [objectKey] : ParticularObj[Objkey]})
|
||||
resolve(OverAllobject)
|
||||
@ -86,6 +88,7 @@ async function ARRAY(Array , GenInfoObj , OverallKey) {
|
||||
{
|
||||
Array.forEach(async(element,index,array) => {
|
||||
for (var [Key, Value] of Object.entries(element)) {
|
||||
// if(Value == ""){delete element[Key];}
|
||||
if (typeof Value === "object" && ( Value !== null )) {
|
||||
Obj = await OBJECT( element, Key , Value );
|
||||
Object.assign(ArrayObj, Obj )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user