Developing my RestAPI using XDEVAPI talking to MySQL. This piece of code works for adding a new record,
myRecord.add = (newmyRecord, res) =>
{
mysql.getSession(mydb) // .getSession() is a Promise, returns a session
.then
(
sess =>
{
sess.getSchema("myschema").getTable("mytable").insert(...).execute(row=>{console.log('inserted')});
res.send(200); // resulting "UnhandledPromiseRejectionWarning: TypeError: res.send is not a function"
//return 200; // Postman still shows "Sending" and Fiddler does not show status 200
}
);
}
So my question is how to send back a successful 200 to complete the POST?