mirror of
https://github.com/kc4x4sar/d4h-typescript.git
synced 2026-07-12 17:21:05 -07:00
Update Member Data
* Implemented member updates * Updated async method names with async suffix
This commit is contained in:
+14
-3
@@ -15,8 +15,20 @@ let getMembersOptions: GetMembersOptions = {
|
||||
};
|
||||
|
||||
let main = async function() {
|
||||
// Only execute update code on an instance where that's OK.
|
||||
// Double-check your API key. Double-check what you're modifying.
|
||||
/*try {
|
||||
const memberId = 0000 // Set this to a real ID
|
||||
await api.updateMemberAsync(memberId, {
|
||||
notes: null,
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
return;
|
||||
}*/
|
||||
|
||||
try {
|
||||
let members = await api.getMembers(getMembersOptions);
|
||||
const members = await api.getMembersAsync(getMembersOptions);
|
||||
console.log(`Retrieved ${members.length} members.`);
|
||||
} catch (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
@@ -24,13 +36,12 @@ let main = async function() {
|
||||
}
|
||||
|
||||
try {
|
||||
let groups = await api.getGroups();
|
||||
const groups = await api.getGroupsAsync();
|
||||
console.log(`Retrieved ${groups.length} groups.`);
|
||||
} catch (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
main().then(() => console.log("Execution complete"));
|
||||
Reference in New Issue
Block a user