mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Send websocket when channel is created.
This commit is contained in:
parent
58a3da386a
commit
6c1dbff91c
1 changed files with 10 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue