updateApi:GWM
This commit is contained in:
parent
f466c23d57
commit
eccf7d2dc1
@ -47,13 +47,35 @@ exports.updateNotes = async (req, res) =>
|
|||||||
{
|
{
|
||||||
sheet_no = value.index + 1;
|
sheet_no = value.index + 1;
|
||||||
notesData = await Workingnotes.findOne({where :{losid : req.body.losid , module_name : req.body.module_name, sheet_no : sheet_no , is_active:1}});
|
notesData = await Workingnotes.findOne({where :{losid : req.body.losid , module_name : req.body.module_name, sheet_no : sheet_no , is_active:1}});
|
||||||
id = notesData.dataValues.id;
|
|
||||||
notes = JSON.stringify(value);
|
|
||||||
|
|
||||||
// update working notes data
|
if(notesData != undefined)
|
||||||
await Workingnotes.update({notes: notes , updatedby: req.body.updatedby} , { where: { id: id } })
|
{
|
||||||
.then(data=>{ logMsg.info("Notes update Success");})
|
id = notesData.dataValues.id;
|
||||||
.catch(err=>{ logMsg.info("Notes update Failed");});
|
notes = JSON.stringify(value);
|
||||||
|
|
||||||
|
// update working notes data
|
||||||
|
await Workingnotes.update({notes: notes , updatedby: req.body.updatedby} , { where: { id: id } })
|
||||||
|
.then(data=>{ logMsg.info("Notes update Success");})
|
||||||
|
.catch(err=>{ logMsg.info("Notes update Failed");});
|
||||||
|
|
||||||
|
}else{
|
||||||
|
notes = JSON.stringify(value);
|
||||||
|
data = {
|
||||||
|
losid: req.body.losid,
|
||||||
|
module_name: req.body.module_name,
|
||||||
|
entity_reference: req.body.entity_reference,
|
||||||
|
notes: notes,
|
||||||
|
sheet_no : value.index + 1,
|
||||||
|
user_id: req.body.user_id,
|
||||||
|
createdby: req.body.createdby
|
||||||
|
};
|
||||||
|
// insert working notes data
|
||||||
|
await Workingnotes.create(data)
|
||||||
|
.then(data=>{ logMsg.info("Notes insert Success");})
|
||||||
|
.catch(err=>{ logMsg.info("Notes insert Failed");});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user