Skip to content

Commit

Permalink
Merge pull request #401 from Monstarrrr/fix/0_rename_savedposts
Browse files Browse the repository at this point in the history
rename saved_posts to followedPosts for frontend
  • Loading branch information
seporterfield authored Dec 18, 2024
2 parents fa9c7c4 + 4c87fab commit 2a40c97
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ class Meta:
]


class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ["username", "avatar", "bio", "reputation"]


class PostSerializer(serializers.ModelSerializer):
ownerUser = serializers.SerializerMethodField()

Expand Down Expand Up @@ -128,6 +122,14 @@ def get_ownerUser(self, obj):
return None


class UserProfileSerializer(serializers.ModelSerializer):
followedPosts = PostSerializer(source="saved_posts", many=True, read_only=True)

class Meta:
model = UserProfile
fields = ["username", "avatar", "bio", "reputation", "followedPosts"]


class ReportSerializer(serializers.ModelSerializer):
class Meta:
model = Report
Expand Down

0 comments on commit 2a40c97

Please sign in to comment.