Im new to javascript, but I'm not quite sure how I'm missing a Success / Error call, I looked through and it looks all called to me.
Parse.Cloud.job("UpdateWeekData", function(request, response) {
var weeks = [];
var weekCount = 0;
var weekQuery = new Parse.Query("WeekList");
weekQuery.find({
success: function(results) {
for (week in results) {
var weekCount = Parse.Query("Schedule");
weekQuery.equalTo("weekObj", week);
weekQuery.count({
success:function(count) {
var max = week.get("maxAppts");
week.set("apptsRemain", (max - count));
week.set("numApptsSch", count);
week.save();
},
error: function(error) {
response.error(error.message);
}
});
}
} ,
error: function(error) {
response.error(error.message);
}
});
});
Any idea where I'm missing the call? Parse Cloud Code is saying "success/error was not called"