I've created a basic Web API along with an ionic/angularJs
Client to perform CRUD operations. However, I encountered an error when attempting to edit data on the server.
Below is an image showcasing the data format being sent and the error received:
https://i.sstatic.net/RL4kF.png
Here is the angularJS method for updating:
$scope.save = function (location) {
var obj = {
//locationId: $scope.id,
locationName: location.locationName,
locationDescription: location.locationDescription
};
console.log('output: ' + JSON.stringify(obj));
$http.put(ServerPath + "/" + $scope.id, $scope.id, obj).success(function (data) {
$state.go('tab.home');
}).error(function (data) {
$scope.error = "An error has occurred while updating! " + data;
console.log('Error: ' + data);
});
};