javascript - Parse Promises, destroyAll(); not working? -


the second line in code below not executing during cloud job, why might case? prior line runs fine.

parse.object.destroyall(apples).then(function() {   return parse.object.destroyall(pears); //destroy pear objects. }, function(error) {   status.error("failed destroy apples/pears."); });  status.success("successfully deleted " + results.length + " pears."); 

your status.success run synchronously before destroyall(pears) chance run

try way

parse.object.destroyall(apples).then(function() {     return parse.object.destroyall(pears); //destroy pear objects. }).then(function() {     status.success("successfully deleted " + results.length + " pears."); }, function(error) {     status.error("failed destroy apples/pears."); }); 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -