From 6c1dbff91cb2e52084848b32869b1d45656f0f11 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sun, 14 Sep 2025 13:27:31 -0500 Subject: [PATCH] Send websocket when channel is created. --- apps/channels/api_views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index 43f0eca6..fb1037a4 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -703,6 +703,16 @@ class ChannelViewSet(viewsets.ModelViewSet): for profile in profiles ]) + # Send WebSocket notification for single channel creation + from core.utils import send_websocket_update + send_websocket_update('updates', 'update', { + 'type': 'channels_created', + 'count': 1, + 'channel_id': channel.id, + 'channel_name': channel.name, + 'channel_number': channel.channel_number + }) + return Response(serializer.data, status=status.HTTP_201_CREATED) @swagger_auto_schema(