Problem with Todo tutorial
Problem with Create service generated by API Express.
I have been following, with great care, the Youtube tutorial "Building a To-Do App" from Sep 1st 2015 - following the steps in the tutorial whilst using my own database and data.
The list function works fine, proving that I have a working database connection. The create function, to add a row to the collection, does not work with the following message displayed in the console log:
POST https://api.appery.io/rest/1/apiexpre... 400 (Bad Request)
The generated code for the "add" function is as follows:
var requestData = {};
requestData = (function mapping5547($scope){
var requestData = {};
requestData = Apperyio.EntityAPI('APIExpress_create.request.data', undefined, true);
Code: Select all
var bloodtest_scope = $scope.bloodtest;
requestData.DateOfTest = bloodtest_scope.DateOfTest;
requestData.LDHCholesterol = bloodtest_scope.LDHCholesterol;
requestData.HDLCholesterol = bloodtest_scope.HDLCholesterol;
requestData.Triglyceride = bloodtest_scope.Triglyceride;
requestData.TotalCholesterol = bloodtest_scope.TotalCholesterol;
return requestData;
})($scope);
// read more about using rest services: https://devcenter.appery.io/documenta...
Apperyio.get("APIExpress_create")(requestData).then(
Code: Select all
function(success){ // success callback
$scope.loadBloodTests();
$scope.$apply();
},
function(error){ // callback to handle request error
},
function(notify){ // notify callback, can fire few times
});
Thanks,
Dave