susee , update atnwRelInp api

This commit is contained in:
suseendhiran17 2022-06-28 18:01:27 +05:30
parent 7eb804d455
commit f68f6e396c

View File

@ -768,28 +768,34 @@ exports.updateATNWrelatedInputs = async (req, res) =>
// update value
ATNWrelatedInputs.update(req.body,{ where: { id: id }}).then(data =>
{
if (req.body.atnw_related_input_id == 8)
{
update_subValue_data.forEach( async (update_subValue_data_element) => {
id = update_subValue_data_element.id;
delete update_subValue_data_element.id;
ATNErelatedInputSubVal.update(update_subValue_data_element,{ where: { id: id }}).then(data =>
{
res.send({'status':200,'message':"success",'data':data});
})
.catch(err => {
res.send({'status':404,
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
});
});
}
else
{
res.send({'status':200,'message':"success",'data':data});
}
logMsg.info("ATNWrelatedInputs Data Update Success "+data);
})
.catch(err => {
res.send({'status':404,
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
});
if (req.body.atnw_related_input_id == 8)
{
update_subValue_data.forEach( async (update_subValue_data_element) => {
id = update_subValue_data_element.id;
delete update_subValue_data_element.id;
ATNErelatedInputSubVal.update(update_subValue_data_element,{ where: { id: id }}).then(data =>
{
res.send({'status':200,'message':"success",'data':data});
})
.catch(err => {
res.send({'status':404,
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
});
});
}
} catch(err) {