My cloud log says that it cannot call the method "success" of undefined at query.first.success however i dont understand this because my console.log is showing up which is called inside of the success block. What is undefined in this code?
var query = new Parse.Query("Messages");
query.first({
success: function(results, response){
console.log("The first object was retrieved");
body = (results.get("messageBody"));
senderName = (results.get("senderName"));
senderId = (results.get("senderId"));
results.destroy({
success: function(results){
}, error: function(results, error){
}
});
response.success(results);
}, error: function(error){
response.error("Error");
}
});