categoryRate is as per the last image above
if is a var based on the model "EmployeeCategoryRate"
There is an _id (for the DB table row),the rate and 3 pointers to other tables for Scheme,Employee and Category.
I want to update the rate for that one _id and do not need to update any of the 3 pointer columns. So this is what doesnt work and will execute the "function(error)"
code
var requestData = {};
requestData = (function mapping4523($scope){
var requestData = {};
requestData.params = Apperyio.EntityAPI('RossTrustees_SchemeEmployeeRates_update_service.request.query', undefined, true);
requestData.data = Apperyio.EntityAPI('RossTrustees_SchemeEmployeeRates_update_service.request.body', undefined, true);
var categoryRate_scope = $scope.categoryRate;
requestData.params.id = categoryRate_scope.id;
requestData.data.Rate=categoryRate_scope.Rate;
return requestData;
})($scope);
// read more about using rest services: https://devcenter.appery.io/documentation/angularjs/rest-service/
Apperyio.get("RossTrustees_SchemeEmployeeRates_update_service")(requestData).then(
function(success){ // success callback
console.log("Updated rate");
},
function(error){ // callback to handle request error
console.log("Failed to update rate");
},
function(notify){ // notify callback, can fire few times
});
}
/code
So perhaps I'm asking the wrong question. Let me re-phrase it please.
If I have a DB table with 20 columns, one of which will be a unique ID called "_id" and say one column called "number", what model/variables/code would work to set the "number" column to 100 using the _id without changing any of the other 18 columns?