I’m using node and a Sequelize (6.37.1) update query and it is stalling continuously. This is the only query with issues. This is a CRUD app where inputs are contextual so I’m using Ajax to post a JSON object and I can confirm the query is executing; terminal shows the following:
Executing (default): UPDATE [entities] SET [fname1]=@0,[lname1]=@1...
Here is the post script…
const rowObject = JSON.parse(JSON.stringify(entity))
$.ajax({
type: "POST",
url: '/api/entities/update',
data: rowObject,
dataType: 'application/json',
})
console.log ('Updating Single Entity:'+ document.getElementById("entityID").value + JSON.stringify(rowObject))
It appears to be performing as it should be – I can see the JSON object in the console and it executes but I get the following result:
I simplified the model query but it still stalled – current query is shown as follows:
exports.update = (req, res) => {
try {
console.log("Sending Single through the server = " + req.body.chkSec)
Entities.update({
fname1: req.body.fname1,
lname1: req.body.lname1,
//Other key:value - not all shown
},
{where:{entityID:JSON.parse(req.body.entityID)}}
).then((result)=>{return result})
}catch(error){
console.log (error)
}
}
This is my first real attempt at building an app like this so I may be missing something simple. I don’t understand why it is stalling.
3