...args (VoteInputArgs): An array containing the following information in order:
pollTypeId (PollTypes): The type of the poll (SingleChoice or MultipleChoice).
pollId (EntryIdType): The ID of the poll for which to submit the vote.
optionIds (EntryIdType[]): An array of option IDs representing the user's vote.
userId (string): The unique user identifier.
Returns:
A Promise resolving to the updated poll object (Poll), including information such as the poll ID, name, creation date, associated poll type, and updated vote counts.
Example:
constvoteArgs= [PollTypes.SingleChoice,1, [1],'user-123'];try{constupdatedPoll=awaitpollz.polls.vote(...voteArgs);console.log('Vote Submitted:',updatedPoll);}catch (error) {console.error('Failed to submit vote:',error.message);}
The vote method allows users to submit their votes for a specific poll. Provide the poll type (pollTypeId), the poll ID (pollId), an array of option IDs representing the user's vote (optionIds), and the unique user identifier (userId).
The method returns a Promise resolving to the updated poll object (Poll), which includes details such as the poll ID, name, creation date, associated poll type, and updated vote counts for each option.
Note: Ensure that the provided poll type, poll ID, option IDs, and user ID are valid and correspond to an existing poll in the system.