DavidE
Posts: 0
Joined: Wed Apr 27, 2016 6:49 am

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Problem with Todo tutorial

Hello David,

Please send us full response from the server with that error (you can find it in the network tab of the browser (response tab))

Dave Ebbitt
Posts: 0
Joined: Thu Apr 28, 2016 8:48 am

Problem with Todo tutorial

Here you go, Sergiy .....

Image

Dave Ebbitt
Posts: 0
Joined: Thu Apr 28, 2016 8:48 am

Problem with Todo tutorial

Any thoughts, Sergiy?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Problem with Todo tutorial

Sorry, but I meant error response data from the server, this is an example: https://developer.chrome.com/devtools...

Return to “Issues”