feat: polls with live voting via WebSocket
- /poll command opens creation modal (2-10 options) - PollDisplay with vote bars, percentages, live WS updates - Backend: polls/poll_options/poll_votes tables, Create/Get/Vote endpoints - attachPolls enriches message list responses - POLL_UPDATE broadcast on vote for real-time sync
This commit is contained in:
@@ -226,6 +226,12 @@ func main() {
|
||||
message.NewHandler(database.DB, hub, pushHandler, logger, permissionsChecker).RegisterRoutes(r)
|
||||
})
|
||||
|
||||
// Polls
|
||||
pollHandler := message.NewPollHandler(database.DB, hub, permissionsChecker)
|
||||
r.Route("/polls", func(r chi.Router) {
|
||||
pollHandler.RegisterRoutes(r)
|
||||
})
|
||||
|
||||
// Per-channel notification settings
|
||||
r.Route("/channels/{channelID}/notifications", func(r chi.Router) {
|
||||
notification.NewHandler(database.DB, logger).RegisterRoutes(r)
|
||||
|
||||
Reference in New Issue
Block a user