deleteOne()
deleteOne(id: EntryIdType): Promise<void>
Delete a poll.
Parameters:
id(EntryIdType): The ID of the poll to be deleted.
Returns:
A
Promiseresolving tovoidindicating the successful deletion of the specified poll.
Example:
const pollIdToDelete = 1;
try {
await pollz.polls.deleteOne(pollIdToDelete);
console.log('Poll Deleted Successfully.');
} catch (error) {
console.error('Failed to delete poll:', error.message);
}The deleteOne method allows you to delete a specific poll identified by its unique ID (id). Once deleted, the poll and its associated data, including options and votes, will be permanently removed from the system.
The method returns a Promise resolving to void, indicating the successful deletion of the specified poll.
Note: Ensure that the provided id corresponds to an existing poll in the system.
Last updated