updateOtherincome : suseendhiran

This commit is contained in:
suseendhiran17 2022-07-28 10:29:23 +05:30
parent 4e7f57113b
commit adc1249600
3 changed files with 4491 additions and 52 deletions

View File

@ -54,20 +54,23 @@ exports.updateOtherIncome = async (req, res) =>
{
try
{
IncomeData = req.body;
var updateOtherIncome = new Promise(async(resolve, reject) => {
for(const IncomeData of req.body)
{
await OtherIncomeP.update({updatedby:IncomeData.updatedby},{where:{id:IncomeData.id}}).catch(err=>{logMsg.info(err);});
IncomeData.childData.forEach(async(child_data) => {
for(const [index , child_data] of IncomeData.childData.entries())
{
await OtherIncomeC.update({value:child_data.value},{where:{id:child_data.id,other_income_id:child_data.other_income_id,column_name:child_data.column_name}})
.then(data=>{
if (index === [IncomeData.childData].length -1) { resolve(data); }
})
.catch(err=>{logMsg.info(err);});
}
}
});
updateOtherIncome.then(async(data)=>{
res.send({'status':200 , message:"Success." ,'data': data});
});
setTimeout(() => {
res.send({'status':200 , message:"Success." ,'data': "no data"});
}, 300);
} catch(err) {
res.status(500).send({'status':404,

4509
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,6 @@
"sequelize": "^6.6.5",
"swagger-jsdoc": "^6.1.0",
"swagger-ui-express": "^4.1.6",
"sync": "^0.2.5",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^4.5.5"
},