susee , update atnwRelInp api
This commit is contained in:
parent
7eb804d455
commit
f68f6e396c
@ -768,28 +768,34 @@ 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 =>
|
||||||
{
|
{
|
||||||
|
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);
|
logMsg.info("ATNWrelatedInputs Data Update Success "+data);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
res.send({'status':404,
|
res.send({'status':404,
|
||||||
message: err.message || "Some error occurred while retrieving statements." ,'data': "No data" });
|
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) {
|
} catch(err) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user