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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -