-
Notifications
You must be signed in to change notification settings - Fork 0
refreshRoster
Matthew Grist edited this page Nov 14, 2022
·
1 revision
refreshRoster()
- version 1.0.0
The refreshRoster
method updates the member list with the most recent roster data from your chapter. This is useful when recent changes may have been made to the roster (e.g. members have been added or removed) and you want to ensure the member list data is up-to-date.
-
Input Parameters: none.
- Return Type: promise - on success, the updated member list is returned in an array of objects, and on failure an error message.
- Async: yes - this method utilizes an external API call to the ACM servers, so this is an async function that returns a promise.
- Important Note: this method cannot be called before the login method. It may take a few seconds to execute due to latency with the ACM servers.
const Chapter = require("acm-roster");
async function main() {
const client = new Chapter();
try {
// log in to ACM client, store members in variable
var memberList = await client.login("username", "password");
...
...
...
// update memberList with most recent roster data
memberList = await client.refreshRoster();
} catch (err) {
console.log("-- Critical Error --");
throw err;
}
}