I have a mobile app written using Apache Cordova. I am using Azure Mobile Apps to store some data.
I created Easy Tables and 1 Easy API. The purpose of the API is to perform delete / update more than 1 record. Below is the implementation of the API.
exports.post = function (request, response){ var mssql = request.service.mssql; var sql = "delete from cust where deptno in ( ? )"; mssql.query(sql, [request.parameters],{ success : function(result){ response.send(statusCodes.OK, result); }, error: function(err) { response.send(statusCodes.BAD_REQUEST, { message: err}); } }); } Is there any other way to implement it ? The del() method on table object on takes id to delete and I didn't find any other approach to delete multiple rows in the table.
I am having difficulty to test the implementation as the changes in the API code is taking 2-3 hours on average to get deployed. I change the code through Azure website and when I run it, the old code is hit and not the latest changes.
Is there any limitation based on the plans we choose?
Update
The updated code worked.
var sql = "delete from trollsconfig where id in (" + request.body.id + ")"; mssql.query(sql, [request.parameters],{ success : function(result){ response.send(statusCodes.OK, result); }, error: function(err) { response.send(statusCodes.BAD_REQUEST, { message: err}); } });