This method sends a request to create a poll in the specified room via a socket event.
It also handles the response from the server to notify the user whether the poll was
created successfully or if there was an error.
Param: options
The options for creating the poll.
Param: options.poll
The poll object containing the poll details.
Param: options.socket
The socket instance for emitting events.
Param: options.roomName
The name of the room where the poll will be created.
Param: options.showAlert
Optional function to show alert messages.
Param: options.updateIsPollModalVisible
Function to update the visibility of the poll modal.
Returns
A promise that resolves when the poll is created successfully.
Throws
Will handle any errors during the poll creation process silently.
Handles the creation of a poll.
This method sends a request to create a poll in the specified room via a socket event. It also handles the response from the server to notify the user whether the poll was created successfully or if there was an error.
Param: options
The options for creating the poll.
Param: options.poll
The poll object containing the poll details.
Param: options.socket
The socket instance for emitting events.
Param: options.roomName
The name of the room where the poll will be created.
Param: options.showAlert
Optional function to show alert messages.
Param: options.updateIsPollModalVisible
Function to update the visibility of the poll modal.
Returns
A promise that resolves when the poll is created successfully.
Throws
Will handle any errors during the poll creation process silently.
Example