Skip to content

Commit

Permalink
[Chore] Add blocked to friends routes
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarm committed May 8, 2024
1 parent cf0de8d commit d54ed23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/back-end/dashboards/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class Meta:
fields = ('id', 'username', 'image_url', 'friends')

def get_friends(self, obj):
friends_data = Friendship.objects.filter(Q(user_from = obj)| Q(user_to= obj))
friends_data = Friendship.objects.filter(Q(user_from = obj)| Q(user_to= obj) |
Q(u_one_is_blocked_u_two = False)|
Q(u_two_is_blocked_u_one = False))
serializer = FriendshipSerializer(friends_data, many=True, context = {'id': obj.id})
return serializer.data

Expand Down
2 changes: 1 addition & 1 deletion app/front-end/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ RUN npm run build

EXPOSE 3000

CMD ["npm", "run", "dev"]
CMD ["npm", "start"]

0 comments on commit d54ed23

Please sign in to comment.