Skip to content

Commit 35a59f1

Browse files
committed
use serializes to return jitsi channels
1 parent bbabce7 commit 35a59f1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

classroom/views.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ class GetClassroomJitsiChannelsView(views.APIView):
7171

7272
def get(self, request):
7373
user: ManthanoUser = request.user
74-
response = {}
75-
for i in user.classroom.jitsi_channels.all():
76-
response[i.id] = i.name
74+
serializer = JitsiChannelSerializer(user.classroom.jitsi_channels.all(), many=True)
75+
7776
if user.classroom is not None:
78-
return Response(response, status=status.HTTP_200_OK)
77+
return Response(serializer.data, status=status.HTTP_200_OK)
7978
return Response(status=status.HTTP_404_NOT_FOUND)
8079

8180

0 commit comments

Comments
 (0)