I'm trying to make an update by http call on fullcalendar drop event but getting "TypeError: Converting circular structure to JSON at Object.stringify (native)" error.
this is the client side code:
drop: function() {
$scope.schedule.tmpevents = $scope.schedule.events;
$http.put('/api/schedules/updatetemp/' + $scope.schedule._id, $scope.schedule).success(function(){
alert("temp schedule updated");
});
},
server side code:
exports.updatetemp = function(req, res) {
Schedule.update({_id: req.params.scheduleid}, {$set: {tmpevents: req.body.tmpevents}}, function(err, result){
if (err) {
console.log(err);
return handleError(res, err);
}
return res.status(200).json(result);
});
};
the very same code works when I call it after the update button click and it updates the temp events but when I call it at the end of a function but when it's called from fullcalendar's drop event it gives out this error. I appreciate any help..
$scope.scheduleyour event? - tymeJV