From 1daa88f224fd73cdf89666d7de7ddeaa472471bb Mon Sep 17 00:00:00 2001 From: fnzksxl Date: Thu, 29 Aug 2024 05:03:12 +0900 Subject: [PATCH] =?UTF-8?q?#88=20Feat:=20Team=20Response=20=EC=9D=B8?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit is_approved 추가로 승인/미승인 프론트에서 확인 가능 --- wtnt/team/serializers.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/wtnt/team/serializers.py b/wtnt/team/serializers.py index 18d13b1..8da5336 100644 --- a/wtnt/team/serializers.py +++ b/wtnt/team/serializers.py @@ -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() @@ -48,6 +49,7 @@ class Meta: "url", "category", "uuid", + "is_approved", ] def get_image_url(self, obj): @@ -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"