Skip to content

Commit

Permalink
#88 Feat: Team Response 인자 수정
Browse files Browse the repository at this point in the history
is_approved 추가로 승인/미승인 프론트에서 확인 가능
  • Loading branch information
fnzksxl committed Aug 28, 2024
1 parent c35dad2 commit 1daa88f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion wtnt/team/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TeamCreateSerializer(LeaderInfoIncludedSerializer):
view = serializers.IntegerField(read_only=True)
image = serializers.CharField(write_only=True)
uuid = serializers.UUIDField(write_only=True)
is_approved = serializers.BooleanField(read_only=True)
leader_id = serializers.IntegerField(write_only=True)
image_url = serializers.SerializerMethodField()
explain = BinaryField()
Expand All @@ -48,6 +49,7 @@ class Meta:
"url",
"category",
"uuid",
"is_approved",
]

def get_image_url(self, obj):
Expand Down Expand Up @@ -147,11 +149,24 @@ def get_user_info(self, obj):
class TeamListSerializer(LeaderInfoIncludedSerializer):
category = TeamTechCreateSerializer(many=True, read_only=True)
image = serializers.CharField(write_only=True)
is_approved = serializers.BooleanField(read_only=True)
image_url = serializers.SerializerMethodField()

class Meta:
model = Team
fields = ["id", "title", "image", "image_url", "category", "leader_info", "like", "version", "view", "genre"]
fields = [
"id",
"title",
"image",
"image_url",
"category",
"leader_info",
"like",
"version",
"view",
"genre",
"is_approved",
]

def get_image_url(self, obj):
return obj.image + "thumnail.jpg"
Expand Down

0 comments on commit 1daa88f

Please sign in to comment.