Skip to content

Commit

Permalink
Merge branch 'feature/friend-request' of https://github.com/GDSC-Hong…
Browse files Browse the repository at this point in the history
…ik/MGU-Yulliy-server into feature/friend-request
  • Loading branch information
ybkang1108 committed Aug 5, 2024
2 parents 07eb5b6 + 7805cd6 commit d43a535
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions friends/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

from django.shortcuts import get_object_or_404

from django.shortcuts import get_object_or_404


@api_view(["GET"])
# @login_required
Expand All @@ -38,9 +40,9 @@ def friend_restaurant_list(request, id):
friend_restaurants = UserRestaurantsList.objects.filter(user=friend)
restaurant_ids = friend_restaurants.values_list("restaurant_id", flat=True)
restaurants = Restaurant.objects.filter(id__in=restaurant_ids)

serializer = RestaurantlistSerializer(restaurants, many=True)

return Response({"results": serializer.data}, status=status.HTTP_200_OK)
except User.DoesNotExist:
return Response(
Expand Down

0 comments on commit d43a535

Please sign in to comment.