Handles the end of a poll by emitting an "endPoll" event through the provided socket. Displays an alert based on the success or failure of the operation.
The options for ending the poll.
A promise that resolves when the poll end operation is complete.
Handles the end of a poll by emitting an "endPoll" event through the provided socket. Displays an alert based on the success or failure of the operation.
Param: options
The options for ending the poll.
Param: options.pollId
The ID of the poll to end.
Param: options.socket
The socket instance to emit the event.
Param: options.showAlert
Optional function to display alerts.
Param: options.roomName
The name of the room where the poll is being conducted.
Param: options.updateIsPollModalVisible
Function to update the visibility of the poll modal.
Returns
A promise that resolves when the poll end operation is complete.
Throws
Will log an error if the operation fails to emit the end poll event.
Example