I have a problem at the time of editing, when I click on the button it looks for the information of the fields in the console.log, already has the ID in the route also the problem is that it does not update the information in the bank, p>
exports.edit = function (req, res){
var editaRegiao = req.body;
var municipiosarray = [];
for(var i = 0; i < editaRegiao.municipio.length; i++){
municipiosarray.push(editaRegiao.municipio[i].id);
}
municipiosarray.toString()
console.log(req.body);
client.query('update cnes.regiao set descricao = ' + editaRegiao.descricao + ', municipio = ' + editaRegiao.municipio + 'where codigoregiao = ' + req.params.id, (err, result) => {
if (err) return res.json(err);
console.log(err);
console.log(result);
return res.json(result.rows);
})
};