Skip to content

Commit

Permalink
Adjust serialize optino for single item query
Browse files Browse the repository at this point in the history
  • Loading branch information
sukso96100 committed Jul 25, 2024
1 parent e00de4a commit 590ebcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kiosksvc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def get(self, request):
def search_participants(request):
participants = Participant.objects.filter(email__contains=request.query_params['keyword'])
serializer = ParticipantSerializer(participants, many=True)
return JsonResponse(serializer.data)
return Response(serializer.data)

@api_view(['GET'])
@authentication_classes([authentication.TokenAuthentication])
def get_participant(request):
participant = Participant.objects.get(id=request.query_params['id'])
serializer = ParticipantSerializer(participant, many=True)
return JsonResponse(serializer.data)
serializer = ParticipantSerializer(participant)
return Response(serializer.data)


class CheckInByCode(APIView):
Expand Down

0 comments on commit 590ebcb

Please sign in to comment.