diff --git a/app/controllers/creditpd.controller.js b/app/controllers/creditpd.controller.js index a35f4c9..f2dd514 100644 --- a/app/controllers/creditpd.controller.js +++ b/app/controllers/creditpd.controller.js @@ -89,7 +89,8 @@ exports.PullCreditPdData = async (req, res) => { if (temp_array.length > 0) { - temp_array.forEach(async(element) => { + temp_array.forEach(async(element) => { + if (OverallKey == "Borrower & Guarantor Details" && element.entity_type.toLowerCase() != "individual") { console.log(element.borrower_type.toLowerCase()); Object.assign(element,{borrower_age : element.numbers_of_years_business_running}); delete element.numbers_of_years_business_running; } Object.assign(element , {pd_id : PDID.dataValues.pd_id , ref_no : req.body.pdid} ); Object.assign(element ,obj ); var index = table_name[0].table_name; var tableName = arr[index]; diff --git a/server.js b/server.js index 604cef3..f4f997f 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,9 @@ require('dotenv').config(); const express = require('express') const app = express() +// Enable CORS for all routes +const cors = require('cors'); +app.use(cors()); //it is used to clear cache app.use(function(req, res, next) { res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0")