getAll()
getAll(): Promise<PollType[]>
Get a list of all available poll types.
Returns:
A
Promise
resolving to an array of poll type objects (PollType
).
Example:
try {
const pollTypesList = await pollz.pollTypes.getAll();
console.log('Poll Types List:', pollTypesList);
} catch (error) {
console.error('Failed to retrieve poll types:', error.message);
}
The getAll
method allows you to retrieve a list of all available poll types. It returns a Promise
resolving to an array of poll type objects (PollType
). Each poll type object includes an ID (id
) and a name (name
).
This method is useful for providing users with information about the available poll types they can use when creating new polls.
Last updated