Created
April 17, 2015 17:55
-
-
Save peterzawistowicz/426300a0bce5e3389cc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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