Skip to content

Instantly share code, notes, and snippets.

@peterzawistowicz
Created April 17, 2015 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterzawistowicz/426300a0bce5e3389cc3 to your computer and use it in GitHub Desktop.
Save peterzawistowicz/426300a0bce5e3389cc3 to your computer and use it in GitHub Desktop.
function getApplication(callback) {
console.log("getApplication");
client.getApplications({
name: SP_APP_NAME
}, function(err, applications) {
console.log(applications);
if (err) {
log("Error in getApplications");
throw err;
}
app = applications.items[0];
callback(0);
});
},
function deleteTestAccounts(callback) {
app.getAccounts({
email: TU_EMAIL_REGEX
}, function(err, accounts) {
if (err) throw err;
accounts.items.forEach(function deleteAccount(account) {
account.delete(function deleteError(err) {
if (err) throw err;
});
});
callback(0);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment