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,14 +768,9 @@ exports.updateATNWrelatedInputs = async (req, res) =>
// update value // update value
ATNWrelatedInputs.update(req.body,{ where: { id: id }}).then(data => ATNWrelatedInputs.update(req.body,{ where: { id: id }}).then(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) if (req.body.atnw_related_input_id == 8)
{ {
update_subValue_data.forEach( async (update_subValue_data_element) => { update_subValue_data.forEach( async (update_subValue_data_element) => {
id = update_subValue_data_element.id; id = update_subValue_data_element.id;
delete update_subValue_data_element.id; delete update_subValue_data_element.id;
@ -790,6 +785,17 @@ exports.updateATNWrelatedInputs = async (req, res) =>
}); });
} }
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" });
});
} catch(err) { } catch(err) {