I've been trying to solve this issue for days now and I fear I'm in some sort of infinite loop. I'm trying to delete a user from the cloud code I have setup... using master key, etc etc. I've scoured through the docs, this forum, and everywhere else... with all answers sending me in circles.
Here is my code:
Parse.Cloud.define("deleteUser", function(request, response) {
Parse.Cloud.useMasterKey();
var query = new Parse.Query("User");
query.equalTo("userId", request.params.user);
query.find({
success: function(result) {
query.destroy();
response.success("success");
},
error: function(err,obj){
response.error("Error");
}
});
});
Any ideas what I'm doing wrong??