Skip to content

Commit

Permalink
feat: 200 ok status for no sponsor
Browse files Browse the repository at this point in the history
  • Loading branch information
rb-25 committed Apr 17, 2024
1 parent 67ac173 commit 4336d66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gibspons/spons_app/views/sponsorship.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get(self, request):
return Response({
"event": event_serializer.data,
"sponsorships": []},
status=status.HTTP_404_NOT_FOUND)
status=status.HTTP_200_OK)

total_money_raised = event.money_raised

Expand All @@ -77,7 +77,7 @@ def get(self, request):
else:
sponsor= Sponsorship.objects.filter(company__organisation=org_id)
if not sponsor:
return Response({'detail': 'No sponsors found for the given Organisation ID'}, status=status.HTTP_404_NOT_FOUND)
return Response({'detail': []}, status=status.HTTP_200_OK)
sponsor_serializer = SponsorshipSerializer(sponsor, many=True)
return Response(sponsor_serializer.data, status=status.HTTP_200_OK)

Expand Down

0 comments on commit 4336d66

Please sign in to comment.