|
|
@ -26,7 +26,7 @@ function getHashCode(req) { |
|
|
|
|
|
|
|
const fetchAllInvestorId = async (sendId) => { |
|
|
|
let data = JSON.parse(sendId) |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
for (let i = 0; i < data?.length; i++) { |
|
|
|
await createLiquiloanInvestor(data[i].investor_id, i) |
|
|
|
} |
|
|
|
} |
|
|
@ -67,14 +67,13 @@ const createLiquiloanInvestor = (investor_id, index) => { |
|
|
|
if (currentData) { |
|
|
|
getUrlAndStore(currentData); |
|
|
|
} |
|
|
|
console.log(index, "investor_id-->", investor_id, "currentData-->", currentData.length, "pastData-->", pastData.length) |
|
|
|
}); |
|
|
|
} |
|
|
|
const getUrlAndStore = async (callsData) => { |
|
|
|
|
|
|
|
try { |
|
|
|
let summary = [] |
|
|
|
for (let i = 0; i < callsData.length; i++) { |
|
|
|
for (let i = 0; i < callsData?.length; i++) { |
|
|
|
let checkTrnId = await getInvSummaryIdQuery(callsData[i].request_id); |
|
|
|
if (checkTrnId == 0) { |
|
|
|
let record = {}; |
|
|
@ -121,7 +120,6 @@ const getUrlAndStore = async (callsData) => { |
|
|
|
last_updatedAt: getCurrentDateTime() |
|
|
|
} |
|
|
|
|
|
|
|
console.log("WWWWWWWWWWWWR", record); |
|
|
|
await db.investorSummary.update(record, { |
|
|
|
where: { |
|
|
|
request_id: record.request_id |
|
|
@ -129,10 +127,10 @@ const getUrlAndStore = async (callsData) => { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (summary.length) { |
|
|
|
if (summary?.length) { |
|
|
|
await db.investorSummary.bulkCreate(summary); |
|
|
|
} |
|
|
|
|
|
|
|
console.log("Success getInvestment summary"); |
|
|
|
} |
|
|
|
catch (err) { |
|
|
|
errorLogStatus(err, "nodeJs_liquiloan_getUrlAndStore") |
|
|
|